n32wb031 当主机 APP 读取从机数据时,数据类型只能是uint8_t吗?uint8_t Adc_Data[] = {0x10,0x30};/** * @brief rdtss value require indicate handler * @param * @return * @NOTE Note */static int rdtss_value_req_ind_handler(ke_msg_id_t const msgid, struct rdtss_value_req_ind const *req_value, ke_task_id_t const dest_id, ke_task_id_t const src_id){ NS_LOG_DEBUG("%s\r\n",__func__); // Initialize length uint8_t len = 0; // Pointer to the data uint8_t *data = NULL; // len = APP_RDTSS_MANUFACTURER_NAME_LEN;// data = (uint8_t *)APP_RDTSS_MANUFACTURER_NAME; len = sizeof(Adc_Data); data = (uint8_t *)Adc_Data; // Allocate confirmation to send the value struct rdtss_value_req_rsp *rsp_value = KE_MSG_ALLOC_DYN(RDTSS_VALUE_REQ_RSP, src_id, dest_id, rdtss_value_req_rsp, len); rsp_value->length = len; rsp_value->att_idx = req_value->att_idx; if (len) { // Copy data memcpy(&rsp_value->value, data, len); } // Send message ke_msg_send(rsp_value); return (KE_MSG_CONSUMED);} |