We are comming closer…
You try to do SPI communication t0 the ENC28…
When there is no chip or a chip failure the you SPI communication failes.
Then your result value should be false - due to SPI failure.
Same as no cable!
When I do programming I do something like this:
public bool getMyChipValue(ref bool aValue)
bool myValue = MyChip.Read();
aValue = myValue;
The return value indicates if all went OK - and the aValue is changed if commnunication etc. succeeded and a valid value is read, only.
The return value will in many cases be e.g. and integer to return error codes, also.
In your case the communication fails, then you initial FALSE should not be changed!
Logic is: No cable, no ENC28 chip, no PCB etc. => it will not work!
- so no communication attempts is needed.
Same for the rest…