Je n'ai pas compris ou je dois mettre ça ? Car je n'en mets pas et à quoi sert-il ?
comme vous utilisez ce champs comme un cString la chaîne se termine par un caractère nul. donc quand vous changez le contenu, il faut mettre un caractère nul à la fin. Je ne sais pas si l'application le fait et Je ne sais plus combien d'espace est alloué pour stocker du contenu (de mémoire je pense à 512 octets mais je ne suis pas sûr) donc il se peut aussi qu'écrire un truc trop long mette le bazar.
Il me faudrait plus d'infos car je connais très peu le bluetooth du coup je n'ai pas compris.
trop long à expliquer toute l'architecture BLE. lisez des tutos qui expliquent les concepts. Quelques liens
Introduction to Bluetooth Low Energy
Getting Started with ESP32 Bluetooth Low Energy (BLE) on Arduino IDE
ESP32 Bluetooth Low Energy (BLE) on Arduino IDE [Tutorial]
A quoi sert le (uint16_t)0x2901 ?
La description du profil ressemble à cela
et chaque élément est porteur d'un ID. certains IDs sont définis par la norme.
Ici 0x2901 c'est l'identifiant de référence du descripteur de caractéristique User Description. (GATT)
j'avais gardé dans un coin tous les identifiants référencés (le consortium en rajoute de temps en temps)
0x1811 "Alert Notification Service"
0x180F "Battery Service"
0x1810 "Blood Pressure"
0x1805 "Current Time Service"
0x1818 "Cycling Power"
0x1816 "Cycling Speed and Cadence"
0x180A "Device Information"
0x1800 "Generic Access"
0x1801 "Generic Attribute"
0x1808 "Glucose"
0x1809 "Health Thermometer"
0x180D "Heart Rate"
0x1812 "Human Interface Device"
0x1802 "Immediate Alert"
0x1803 "Link Loss"
0x1819 "Location and Navigation"
0x1807 "Next DST Change Service"
0x180E "Phone Alert Status Service"
0x1806 "Reference Time Update Service"
0x1814 "Running Speed and Cadence"
0x1813 "Scan Parameters"
0x1804 "Tx Power"
0x181A "Environmental Sensing"
0x181B "Environmental Sensing2"
0x181C "User Data"
//+++++++++++++++++++USER DEFINED SERVICES++++++++++++++++++
0xFF10 "led service"
// Characteristics.
0x2A7E "Aerobic Heart Rate Lower Limit"
0x2A84 "Aerobic Heart Rate Upper Limit"
0x2A7F "Aerobic Threshold"
0x2A80 "Age"
0x2A43 "Alert Category ID"
0x2A42 "Alert Category ID Bit Mask"
0x2A06 "Alert Level"
0x2A44 "Alert Notification Control Point"
0x2A3F "Alert Status"
0x2A81 "Anaerobic Heart Rate Lower Limit"
0x2A82 "Anaerobic Heart Rate Upper Limit"
0x2A83 "Anaerobic Threshold"
0x2A01 "Appearance"
0x2A19 "Battery Level"
0x2A49 "Blood Pressure Feature"
0x2A35 "Blood Pressure Measurement"
0x2A38 "Body Sensor Location"
0x2A22 "Boot Keyboard Input Report"
0x2A32 "Boot Keyboard Output Report"
0x2A33 "Boot Mouse Input Report"
0x2A5C "CSC Feature"
0x2A5B "CSC Measurement"
0x2A2B "Current Time"
0x2A66 "Cycling Power Control Point"
0x2A65 "Cycling Power Feature"
0x2A63 "Cycling Power Measurement"
0x2A64 "Cycling Power Vector"
0x2A99 "Database Change Increment"
0x2A85 "Date of Birth"
0x2A86 "Date of Threshold Assessment "
0x2A08 "Date Time"
0x2A0A "Day Date Time"
0x2A09 "Day of Week"
0x2A00 "Device Name"
0x2A0D "DST Offset"
0x2A87 "Email Address"
0x2A0C "Exact Time 256"
0x2A88 "Fat Burn Heart Rate Lower Limit"
0x2A89 "Fat Burn Heart Rate Upper Limit"
0x2A26 "Firmware Revision String"
0x2A8A "First Name"
0x2A8B "Five Zone Heart Rate Limits"
0x2A8C "Gender"
0x2A51 "Glucose Feature"
0x2A18 "Glucose Measurement"
0x2A34 "Glucose Measurement Context"
0x2A27 "Hardware Revision String"
0x2A39 "Heart Rate Control Point"
0x2A8D "Heart Rate Max"
0x2A37 "Heart Rate Measurement"
0x2A8E "Height"
0x2A4C "HID Control Point"
0x2A4A "HID Information"
0x2A8F "Hip Circumference"
0x2A6F "Humidity"
0x2A2A "IEEE 11073-20601 Regulatory Certification Data List"
0x2A36 "Intermediate Cuff Pressure"
0x2A1E "Intermediate Temperature"
0x2AA2 "Language"
0x2A90 "Last Name"
0x2A6B "LN Control Point"
0x2A6A "LN Feature"
0x2A0F "Local Time Information"
0x2A67 "Location and Speed"
0x2A29 "Manufacturer Name String"
0x2A91 "Maximum Recommended Heart Rate"
0x2A21 "Measurement Interval"
0x2A24 "Model Number String"
0x2A68 "Navigation"
0x2A46 "New Alert"
0x2A04 "Peripheral Preferred Connection Parameters"
0x2A02 "Peripheral Privacy Flag"
0x2A50 "PnP ID"
0x2A69 "Position Quality"
0x2A6D "Pressure"
0x2A4E "Protocol Mode"
0x2A03 "Reconnection Address"
0x2A52 "Record Access Control Point"
0x2A14 "Reference Time Information"
0x2A4D "Report"
0x2A4B "Report Map"
0x2A92 "Resting Heart Rate"
0x2A40 "Ringer Control Point"
0x2A41 "Ringer Setting"
0x2A54 "RSC Feature"
0x2A53 "RSC Measurement"
0x2A55 "SC Control Point"
0x2A4F "Scan Interval Window"
0x2A31 "Scan Refresh"
0x2A5D "Sensor Location"
0x2A25 "Serial Number String"
0x2A05 "Service Changed"
0x2A28 "Software Revision String"
0x2A93 "Sport Type for Aerobic and Anaerobic Thresholds"
0x2A47 "Supported New Alert Category"
0x2A48 "Supported Unread Alert Category"
0x2A23 "System ID"
0x2A6E "Temperature"
0x2A1C "Temperature Measurement"
0x2A1D "Temperature Type"
0x2A94 "Three Zone Heart Rate Limits"
0x2A12 "Time Accuracy"
0x2A13 "Time Source"
0x2A71 "True Wind Direction"
//+++++++++++++++++++USER DEFINED CHAR++++++++++++++++++
0xFF12 "switch led"
0xFF11 "led state"
// GATT
0x1800 "Generic Access Profile"
0x1801 "Generic Attribute Profile"
0x2800 "Primary Service"
0x2801 "Secondary Service"
0x2802 "Include"
0x2803 "Characteristic"
0x2900 "Characteristic Extended Properties"
0x2901 "Characteristic User Description"
0x2902 "Client Characteristic Configuration"
0x2903 "Server Characteristic Configuration"
0x2904 "Characteristic Format"
0x2905 "Characteristic Aggregate Format"
0x2A00 "Device Name"
0x2A01 "Appearance"
0x2A02 "Peripheral Privacy Flag"
0x2A03 "Reconnection Address"
0x2A04 "Peripheral Preferred Connection Parameters"
0x2A05 "Service Changed"
