diff --git a/nucleo-wb55-ble/Core/Inc/stm32wbxx_it.h b/nucleo-wb55-ble/Core/Inc/stm32wbxx_it.h index b01d95d..e06a700 100644 --- a/nucleo-wb55-ble/Core/Inc/stm32wbxx_it.h +++ b/nucleo-wb55-ble/Core/Inc/stm32wbxx_it.h @@ -56,7 +56,6 @@ void SVC_Handler(void); void DebugMon_Handler(void); void PendSV_Handler(void); void SysTick_Handler(void); -void EXTI4_IRQHandler(void); void USB_LP_IRQHandler(void); void HSEM_IRQHandler(void); /* USER CODE BEGIN EFP */ diff --git a/nucleo-wb55-ble/Core/Src/app_entry.c b/nucleo-wb55-ble/Core/Src/app_entry.c index 87611f9..f77eed4 100644 --- a/nucleo-wb55-ble/Core/Src/app_entry.c +++ b/nucleo-wb55-ble/Core/Src/app_entry.c @@ -96,15 +96,6 @@ void APPE_Init( void ) return; } /* USER CODE BEGIN FD */ -void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) { - switch (GPIO_Pin) { - case SW1_Pin: - UTIL_SEQ_SetTask(1<payload_ptr + this->get_payload_size())[0] = (uint8_t)was_successful; + this->add_to_payload_size(1); +} + +GPRequest::GPRequest(uint8_t * payload_ptr, uint16_t size) : Request(payload_ptr, size) { + uint16_t expected_length = this->buffer_offset + 1; + if (expected_length != size) { + this->has_error = true; + return; + } + + uint8_t * data_ptr = payload_ptr + this->buffer_offset; + this->command_id = data_ptr[0]; +} + +GPResponse * GPRequest::execute_request(uint16_t response_identifier) { + bool was_successful = true; + + if (this->has_error) { + was_successful = false; + } else { + switch (this->command_id) + { + case 1: + UTIL_SEQ_SetTask(1<P2P_Client_Evt_Opcode=0x%x", 1, pNotification->P2P_Client_Evt_Opcode); + /* USER CODE END Gatt_Notification_1 */ switch(pNotification->P2P_Client_Evt_Opcode) @@ -580,6 +582,8 @@ void Gatt_Notification(P2P_Client_App_Notification_evt_t *pNotification) /* USER CODE BEGIN P2P_NOTIFICATION_INFO_RECEIVED_EVT */ { P2P_Client_App_Context.LedControl.Device_Led_Selection=pNotification->DataTransfered.pPayload[0]; + log_debug("Gatt_Notification", "DataTransfered.pPayload[0]=0x%x", 1, pNotification->DataTransfered.pPayload[0]); + log_debug("Gatt_Notification", "DataTransfered.pPayload[1]=0x%x", 1, pNotification->DataTransfered.pPayload[1]); switch(P2P_Client_App_Context.LedControl.Device_Led_Selection) { case 0x01 : {