diff options
| author | Aditya Naik | 2020-04-22 16:30:15 -0400 |
|---|---|---|
| committer | Aditya Naik | 2020-04-22 16:30:15 -0400 |
| commit | 42a683033594289ddc520dffec652967e366e785 (patch) | |
| tree | b39c2746c5137ee65e021326e1d6ea3f7fe960e2 /src/main-data.c | |
| parent | 3bba7e2e56f3459f5d5d67c81b3fa4a41a8c9176 (diff) | |
Added dataflow protocol files
Diffstat (limited to 'src/main-data.c')
| -rw-r--r-- | src/main-data.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/main-data.c b/src/main-data.c index f228235..4314e9e 100644 --- a/src/main-data.c +++ b/src/main-data.c @@ -16,12 +16,13 @@ /* Library includes */ #include <pb_encode.h> #include <pb_decode.h> -#include "handshake.pb.h" /* Project includes */ +#include "main.h" #include "devices.h" #include "config.h" -#include "main.h" +#include "dataflow.h" +#include "handshake.pb.h" /* Private Macros */ #define device_MDR s2m_MDR_response @@ -53,6 +54,7 @@ static void MX_USART1_UART_Init(void); bool decode_subscriptions_callback(pb_istream_t *istream, const pb_field_t *field, void **args); hs_status_t handshake(uint32_t i2c_addr); +dataflow_status_t device_dataflow(uint8_t i2c_addr); bool todo_hs_or_not_todo_hs(uint8_t i2c_addr); state_t get_state_from_hs_status(uint16_t device_addr, hs_status_t hs_status); bool encode_subscription_callback(pb_ostream_t *ostream, const pb_field_t *field, void * const *arg); @@ -116,7 +118,6 @@ int main(void) device_info[dev_idx]->MDR = module_MDR; /* dataflow */ - #else /* Slave code*/ { @@ -429,6 +430,13 @@ __DEBUG_BLOCK_END: return hs_sts; } +dataflow_status_t device_dataflow(uint8_t i2c_addr) +{ + uint8_t dev_idx = GET_IDX_FROM_ADDR(i2c_addr); + dataflow_status_t status; + +} + bool decode_subscriptions_callback(pb_istream_t *istream, const pb_field_t *field, void **args) { _subscriptions subs; |
