how can i create communicate between by ble connection between two modules securely da14531evz i want to use one gpio with button on one module and second module with led and i want when i press button on first module and led will glow on second module
Hi Mani,Thank you for posting your question online.Please refer on the ble_app_peripheral example inside the SDK. It has custom Services and Characteristics. On that example you can find the Control Point characteristic which controls a LED depending on the value of the Control Point Characteristic. For the Central device please refer here: ble-sdk6-examples/connectivity/central at main · renesas/ble-sdk6-examplesPlease also refer on DA1453x / DA1458x Tutorial Create a Custom GATT Profile — DA145XX Tutorial Create a Custom GATT Profileand on UM-B-119: DA1453x/DA1458x SW Platform Reference Manual — DA14585/DA14531 SW Platform Reference ManualBest Regards,OV_Renesas
I want secure communication by enter passkey how can I do
Hi Mani,Thank you for the reply.Please refer on DA1453x Tutorial BLE Security — DA1453x&DA1458x Tutorial BLE securityPlease go through the whole tutorial but focus on section 7. for LE Secure Connections and implementation of passkey.You should work with the ble_app_security example of the SDK to get a better understanding on how to implement Security on the DA14531. Best Regards,OV_Renesas
what i have to change for connection of both modules firmware in first module :- ble-sdk6-examples-main\ble-sdk6-examples-main\connectivity\central
firmware in second module :- DA145xx_SDK\6.0.22.1401\projects\target_apps\ble_examples\ble_app_peripheral
Hi Mani,Thank you for the reply.Your questions is not directly related with the original question.Please create new tickets/threads for separate questions.
mani said:firmware in first module :- ble-sdk6-examples-main\ble-sdk6-examples-main\connectivity\central firmware in second module :- DA145xx_SDK\6.0.22.1401\projects\target_apps\ble_examples\ble_app_peripheral
firmware in first module :- ble-sdk6-examples-main\ble-sdk6-examples-main\connectivity\central
The Central firmware has been designed to work directly with the prox_reporter example.Specifically it scans for the DLG-PROXR name on the Advertising Data in order to attempt to automatically connect. You will need to change this value on the PERIPH_MATCH_DATA macro on the central example with the name of the device you want.Otherwise you can modify the scan filters to anything you like to establish this connection.Best Regards,OV_Renesas
how can i set led on in both of modules and blink when when they connected with each other
Hi Mani,Thank you for the reply.Please refer on 7. General Purpose Output — DA145XX Tutorial SDK Getting startedand on 4. User Guides — DA14585/DA14531 SW Platform Reference ManualThe app_on_connection callback function will be executed when a connection is established. You will need to reserve and configure a GPIO for your LED. After that, you can create your own custom callback function to be executed upon connection and turn on/off the LED.Best Regards,OV_Renesas
I have connected both central and peripheral when connection i want to button press on the central device triggers an LED to glow on the peripheral device via Bluetooth Low Energy (BLE) please give me example
firmware in first module :- ble-sdk6-examples-main\ble-sdk6-examples-main\connectivity\centralwhat i have to change or send value to my peripheral for glow led on module in my central firmware
Hi Mani,Thank you for the replies.On the peripheral side you should have a custom Characteristic and change the value.The central device should read this characteristic and depending on the value it has read it should open or close the LED.Please refer on DA1453x / DA1458x Tutorial Create a Custom GATT Profile — DA145XX Tutorial Create a Custom GATT ProfileBest Regards,OV_Renesas
I think you don't understand my question
I don't want to use app I'm creating communication between two modules so I'm want to control led on one module from second module I want to use one gpio as button on Central ble example and led on my peripheral example module
For this wht I have to. Changes in firmware.
I have enabled gpio as button on Central and gpio led on peripheral
No wht I have to change in firmware please give me proper example or code
Or suggest me wht example of firmware from SDK for this type of communication
Hi Mani,Thank you for the reply.I have understood your question. For Button press and interrupt please refer here: ble-sdk6-examples/interfaces/simple_button at main · renesas/ble-sdk6-examplesThe above example implementation for GPIO button interrupt can work only in Active mode without any Sleep mode enabled.The best approach would be to follow the GPIO button press implementation from here:ble-sdk6-examples/interfaces/wakeup-button/src/user_wakeup.c at main · renesas/ble-sdk6-examplesYou will use the Wake up controller driver to configure a GPIO as a button.When the button is pressed, it will trigger the callback function you had declared via the wkupct_register_callback API.Inside that callback you will need to use the following API to Write on a specific Characteristic on the Peripheral side:
/** **************************************************************************************** * @brief Perform a gatt write * @param[in] con_idx - connection identifier * @param[in] handle - attribute handle to write * @param[in] data - data to write * @param[in] data_len - data len * @return void **************************************************************************************** */ void user_ble_gatt_write(uint8_t op, uint8_t con_idx, uint16_t handle, uint8_t *data, uint16_t data_len) { struct gattc_write_cmd *cmd = KE_MSG_ALLOC_DYN(GATTC_WRITE_CMD, KE_BUILD_ID(TASK_GATTC, con_idx), TASK_APP, gattc_write_cmd, sizeof(struct gattc_write_cmd) + data_len); cmd->operation = op; cmd->auto_execute = 1; cmd->seq_num = 0; cmd->offset = 0; cmd->length = data_len; cmd->cursor = 0; cmd->handle = handle; memcpy(&cmd->value[0], data, data_len); ke_msg_send(cmd); }
void user_catch_rest_hndl(ke_msg_id_t const msgid, void const *param, ke_task_id_t const dest_id, ke_task_id_t const src_id) { switch(msgid) { case CUSTS1_VAL_WRITE_IND: { struct custs1_val_write_ind const *msg_param = (struct custs1_val_write_ind const *)(param); switch (msg_param->handle) { case SVC1_IDX_CONTROL_POINT_VAL: user_svc1_ctrl_wr_ind_handler(msgid, msg_param, dest_id, src_id); break; case SVC1_IDX_LED_STATE_VAL: user_svc1_led_wr_ind_handler(msgid, msg_param, dest_id, src_id); break; case SVC1_IDX_ADC_VAL_1_NTF_CFG: user_svc1_adc_val_1_cfg_ind_handler(msgid, msg_param, dest_id, src_id); break; case SVC1_IDX_BUTTON_STATE_NTF_CFG: user_svc1_button_cfg_ind_handler(msgid, msg_param, dest_id, src_id); break; case SVC1_IDX_INDICATEABLE_IND_CFG: user_svc1_long_val_cfg_ind_handler(msgid, msg_param, dest_id, src_id); break; case SVC1_IDX_LONG_VALUE_NTF_CFG: user_svc1_long_val_cfg_ind_handler(msgid, msg_param, dest_id, src_id); break; case SVC1_IDX_LONG_VALUE_VAL: user_svc1_long_val_wr_ind_handler(msgid, msg_param, dest_id, src_id); break; default: break; } } break;
void user_svc1_led_wr_ind_handler(ke_msg_id_t const msgid, struct custs1_val_write_ind const *param, ke_task_id_t const dest_id, ke_task_id_t const src_id) { uint8_t val = 0; memcpy(&val, ¶m->value[0], param->length); if (val == CUSTS1_LED_ON) { GPIO_SetActive(GPIO_LED_PORT, GPIO_LED_PIN); } else if (val == CUSTS1_LED_OFF) { GPIO_SetInactive(GPIO_LED_PORT, GPIO_LED_PIN); } }
firmware in first module :- ble-sdk6-examples-main\ble-sdk6-examples-main\connectivity\centralin this firmware what i have to putt in this user_ble_gatt_write in my central firmware to change state of led on my peripheral side please can u provide me central example code which will be completable with this( DA145xx_SDK\6.0.22.1401\projects\target_apps\ble_examples\ble_app_peripheral) firmware
please provide me firmware for my central so when i change value of variable led state will change in my peripheral module
hie please can u provide me firmware for central or tell me in which function i have to change for connection and how to make custom characteristics in central example