2024-11-23 11:57 PM
Hi,
i use the example ble_p2pServer_ota with STM32WBA55. How can i send a value (uint_8 or a string) from the server (NUCLEO-WBA55) to the client (Cell Phone)?
Here in the example code (file p2p_server_app.c), the value of Switch_c_NOTIFICATION_ON for example is 1, but this is an enum and is used as a flag. I want to send an uint_8 or string value from a Sensor. How can i do this?
case P2P_SERVER_SWITCH_C_NOTIFY_ENABLED_EVT:
/* USER CODE BEGIN Service1Char2_NOTIFY_ENABLED_EVT */
P2P_SERVER_APP_Context.Switch_c_Notification_Status = Switch_c_NOTIFICATION_ON; // send the value 1
LOG_INFO_APP("-- P2P APPLICATION SERVER : NOTIFICATION ENABLED\n");
LOG_INFO_APP(" \n\r");
/* USER CODE END Service1Char2_NOTIFY_ENABLED_EVT */
break;
case P2P_SERVER_SWITCH_C_NOTIFY_DISABLED_EVT:
/* USER CODE BEGIN Service1Char2_NOTIFY_DISABLED_EVT */
P2P_SERVER_APP_Context.Switch_c_Notification_Status = Switch_c_NOTIFICATION_OFF; // send the value 0
LOG_INFO_APP("-- P2P APPLICATION SERVER : NOTIFICATION DISABLED\n");
LOG_INFO_APP(" \n\r");
/* USER CODE END Service1Char2_NOTIFY_DISABLED_EVT */
break;