Return errors on open functions
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
This commit is contained in:
parent
2bd57ee0dd
commit
b074ab72fc
8 changed files with 72 additions and 90 deletions
|
@ -60,7 +60,9 @@ enum device3_error_t {
|
|||
DEVICE3_ERROR_UNEXPECTED = 10,
|
||||
DEVICE3_ERROR_WRONG_SIGNATURE = 11,
|
||||
DEVICE3_ERROR_INVALID_VALUE = 12,
|
||||
DEVICE3_ERROR_UNKNOWN = 13,
|
||||
DEVICE3_ERROR_NOT_INITIALIZED = 13,
|
||||
DEVICE3_ERROR_PAYLOAD_FAILED = 14,
|
||||
DEVICE3_ERROR_UNKNOWN = 15,
|
||||
};
|
||||
|
||||
struct __attribute__((__packed__)) device3_packet_t {
|
||||
|
@ -144,7 +146,7 @@ struct device3_t {
|
|||
|
||||
typedef struct device3_t device3_type;
|
||||
|
||||
device3_type* device3_open(device3_event_callback callback);
|
||||
device3_error_type device3_open(device3_type* device, device3_event_callback callback);
|
||||
|
||||
device3_error_type device3_reset_calibration(device3_type* device);
|
||||
|
||||
|
|
|
@ -107,7 +107,9 @@ enum device4_error_t {
|
|||
DEVICE4_ERROR_UNEXPECTED = 6,
|
||||
DEVICE4_ERROR_WRONG_HEAD = 7,
|
||||
DEVICE4_ERROR_INVALID_LENGTH = 8,
|
||||
DEVICE4_ERROR_UNKNOWN = 9,
|
||||
DEVICE4_ERROR_NOT_INITIALIZED = 9,
|
||||
DEVICE4_ERROR_PAYLOAD_FAILED = 10,
|
||||
DEVICE4_ERROR_UNKNOWN = 11,
|
||||
};
|
||||
|
||||
struct __attribute__((__packed__)) device4_packet_t {
|
||||
|
@ -162,7 +164,7 @@ struct device4_t {
|
|||
|
||||
typedef struct device4_t device4_type;
|
||||
|
||||
device4_type* device4_open(device4_event_callback callback);
|
||||
device4_error_type device4_open(device4_type* device, device4_event_callback callback);
|
||||
|
||||
device4_error_type device4_clear(device4_type* device);
|
||||
|
||||
|
|
Reference in a new issue