Espressif ESP32-S2 Programming Manual page 678

Table of Contents

Advertisement

Chapter 2. API Reference
/* Config for protocomm_ble_start() */
protocomm_ble_config_t config
.service_uuid
/* LSB <---------------------------------------
* ---------------------------------------> MSB */
0xfb, 0x34, 0x9b, 0x5f, 0x80, 0x00, 0x00, 0x80,
0x00, 0x10, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00,
},
.nu_lookup_count
table[0]),
.nu_lookup
};
/* Start protocomm layer on top of BLE */
protocomm_ble_start(pc, &config);
/* For protocomm_security0, Proof of Possession is not used, and
be kept NULL */
protocomm_set_security(pc, "security_endpoint",
NULL);
protocomm_add_endpoint(pc, "echo_req_endpoint",
NULL);
return
pc;
}
/* Example function for stopping a protocomm instance */
void
stop_pc(protocomm_t *pc)
{
protocomm_remove_endpoint(pc, "echo_req_endpoint");
protocomm_unset_security(pc, "security_endpoint");
/* Stop BLE protocomm service */
protocomm_ble_stop(pc);
protocomm_delete(pc);
}
API Reference
Header File
components/protocomm/include/common/protocomm.h
Functions
protocomm_t
*protocomm_new(void)
Create a new protocomm instance.
This API will return a new dynamically allocated protocomm instance with all elements of the protocomm_t
structure initialized to NULL.
Return
• protocomm_t* : On success
• NULL : No memory for allocating new instance
void
protocomm_delete(protocomm_t
Delete a protocomm instance.
This API will deallocate a protocomm instance that was created using protocomm_new().
Parameters
Espressif Systems
=
{
=
{
=
sizeof(nu_lookup_table)/sizeof(nu_lookup_
=
nu_lookup_table
*pc)
667
Submit Document Feedback
(continued from previous page)
can␣
&protocomm_security0,␣
echo_req_handler,␣
Release v4.4

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ESP32-S2 and is the answer not in the manual?

Table of Contents

Save PDF