diff options
| author | Aditya Naik | 2020-07-30 14:16:20 -0400 |
|---|---|---|
| committer | Aditya Naik | 2020-07-30 14:16:20 -0400 |
| commit | c8c06aea5199e555235f71acc8547ed2ef0706cf (patch) | |
| tree | e1d72f836873c9fc99dd200dd8829c6f0046b96f /src/devices.h | |
| parent | 70f623d66439a826927b7d2fc9d64ae0cb631b92 (diff) | |
Stream abstraction
Diffstat (limited to 'src/devices.h')
| -rw-r--r-- | src/devices.h | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/src/devices.h b/src/devices.h deleted file mode 100644 index b2cb825..0000000 --- a/src/devices.h +++ /dev/null @@ -1,43 +0,0 @@ - -#include "handshake.pb.h" - -#define _MDR s2m_MDR_response - -typedef struct _device_info { - uint8_t device_id; - uint8_t i2c_addr; - _MDR MDR; - - uint32_t subscription_requests[4]; /* Subscriptions to this device */ - uint32_t subscriptions[4]; /* Subscriptions by this device */ -} device_info_t; - -/* TODO These IDs could be represented as a single 8-bit integer */ -typedef struct _subscription_info { - uint8_t module_ids[128]; - uint8_t entity_ids[128]; - uint8_t module_class[3]; - uint8_t i2c_address[128]; - uint8_t mod_idx, entity_idx, class_idx, i2c_idx; -} subscription_info_t; - -typedef enum hs_status { - IDLE = 0, // send mdr request. success: mdr_ack. fail: hs_fail - HS_MDR_ACK = 1, // get mdr ack. success: mdr_cts. fail: hs_fail - HS_MDR_CTS = 2, // send mdr cts. success: mdr_mdr. fail: hs_fail - HS_MDR_MDR = 3, // get mdr. success: registered. fail: hs_fail - HS_REGISTERED = 4, // send registered. success: exit. fail: hs_fail - HS_FAILED = 5 -} hs_status_t; - -typedef enum state { - NO_HS = 0, /* Initial state: handshake not attempted yet */ - OFFLINE = 1, /* Device not found on bus */ - CONNECTED = 2, /* Device found on bus but handshake not completed */ - REGISTERED = 3, /* Completed handshake; ready for action */ - FAILED = 4, /* Handshake failed */ - NO_DATA = 5 /* ??? */ -} state_t; - -/* Handshake message size definitions */ -#define MDR_req_buf_len 2 |
