first use of libmbus
This commit is contained in:
@ -33,7 +33,7 @@ typedef enum {
|
||||
MBCR_ERROR_STATE_ENGINE__STOP,
|
||||
MBCR_ERROR_STATE_ENGINE__ILLEGAL_STATE,
|
||||
MBCR_ERROR_STATE_ENGINE__UNKNOWN
|
||||
} t_mbusCommResult;
|
||||
} e_mbusCommResult;
|
||||
|
||||
typedef enum {
|
||||
MBCS_IDLE,
|
||||
@ -80,7 +80,7 @@ typedef struct {
|
||||
uint8_t receiveCnt;
|
||||
uint8_t receivedOctet;
|
||||
bool receiving;
|
||||
t_mbusCommResult result;
|
||||
e_mbusCommResult result;
|
||||
t_longframe frame;
|
||||
t_mbusDevice *device;
|
||||
} t_mbusCommHandle;
|
||||
@ -389,7 +389,9 @@ void mbusCommRxCpltCallback(UART_HandleTypeDef *huart) {
|
||||
}
|
||||
}
|
||||
|
||||
void mbusCommRequest(t_mbusDevice *mbusDevice) {
|
||||
e_mbusCommRequestResult mbusCommRequest(t_mbusDevice *mbusDevice) {
|
||||
e_mbusCommRequestResult res = MBCRR_BUSY;
|
||||
|
||||
if (mbusCommHandle.state == MBCS_IDLE) {
|
||||
mbusCommHandle.state = MBCS_SEND;
|
||||
mbusCommHandle.retryCnt = 0;
|
||||
@ -397,8 +399,9 @@ void mbusCommRequest(t_mbusDevice *mbusDevice) {
|
||||
mbusCommHandle.addr = mbusDevice->address;
|
||||
mbusCommHandle.device = mbusDevice;
|
||||
schAdd(handleRequestEngine, (void*) &mbusCommHandle, 0, 0);
|
||||
} else {
|
||||
// busy
|
||||
res = MBCRR_TRIGGERED;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user