From 2aa5ae87f96b4c10ea52b29e356d1eed6103e3e8 Mon Sep 17 00:00:00 2001 From: Aditya Naik Date: Tue, 7 Apr 2020 00:42:05 -0400 Subject: Branching off main hs --- Inc/devices.h | 2 +- Src/main-hs.c | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Inc/devices.h b/Inc/devices.h index 396ae2d..58bc5b7 100644 --- a/Inc/devices.h +++ b/Inc/devices.h @@ -33,7 +33,7 @@ typedef enum state { OFFLINE = 0, /* Device not found on bus */ CONNECTED = 1, /* Device found on bus but handshake not completed */ REGISTERED = 2, /* Completed handshake; ready for action */ - HS_FAILED = 3, /* Handshake failed */ + FAILED = 3, /* Handshake failed */ NO_DATA = 4 /* ??? */ } state_t; diff --git a/Src/main-hs.c b/Src/main-hs.c index 7db3e7a..66d4dd6 100644 --- a/Src/main-hs.c +++ b/Src/main-hs.c @@ -72,7 +72,9 @@ static void MX_GPIO_Init(void); static void MX_I2C1_Init(void); static void MX_USART1_UART_Init(void); /* USER CODE BEGIN PFP */ -bool encode_subscription_callback(pb_ostream_t *ostream, const pb_field_t *field, void * const *arg); +bool decode_subscriptions_callback(pb_istream_t *istream, const pb_field_t *field, void **args); +int handshake(uint32_t i2c_addr); + /* USER CODE END PFP */ /* Private user code ---------------------------------------------------------*/ @@ -554,6 +556,12 @@ bool encode_subscription_callback(pb_ostream_t *ostream, const pb_field_t *field } return true; } + +int handshake(uint32_t i2c_addr) +{ + + return 1; +} /* USER CODE END 4 */ /** -- cgit v1.2.3