I've tried to run the code in my raspberry Pi, but unfortunately it doesn't work properly. It's the same file as the one in github, and I'm afraid it's something related to directories or the bluetoothd version. I copy here the log obtained. (Ignore some " I had to write in order to keep the code integrity)
pi@FrambuesaPi:~ $ sudo btmon
Bluetooth monitor ver 5.50
= Note: Linux version 5.10.103-v7+ (armv7l) 0.972811
= Note: Bluetooth subsystem version 2.22 0.972824
= New Index: B8:27:EB:F3:EB:C5 (Primary,UART,hci0) [hci0] 0.972829
= Open Index: B8:27:EB:F3:EB:C5 [hci0] 0.972835
= Index Info: B8:27:EB:F.. (Cypress Semiconductor Corporation) [hci0] 0.972839
@ MGMT Open: bluetoothd (privileged) version 1.18 {0x0001} 0.972843
@ MGMT Open: btmon (privileged) version 1.18 {0x0002} 0.973232
@ MGMT Command: Add Advertising (0x003e) plen 27 {0x0001} [hci0] 4.271771
Instance: 1
Flags: 0x00000000
Duration: 0
Timeout: 0
Advertising data length: 16
16-bit Service UUIDs (complete): 3 entries
First Name (0x2a8a)
Last Name (0x2a90)
Email Address (0x2a87)
Service Data (UUID 0x2a8a): 5374616e
Scan response length: 0
@ MGMT Event: Advertising Added (0x0023) plen 1 {0x0002} [hci0] 4.271803
Instance: 1
< HCI Command: LE Set Random Address (0x08|0x0005) plen 6 #"1 [hci0] 4.271890
Address: 07:5B:83:7E:02:D3 (Non-Resolvable)
"> HCI Event: Command Complete (0x0e) plen 4 #"2 [hci0] 4.272221
LE Set Random Address (0x08|0x0005) ncmd 1
Status: Success (0x00)
< HCI Command: LE Set Advertising P.. (0x08|0x0006) plen 15 #"3 [hci0] 4.272268
Min advertising interval: 62.500 msec (0x0064)
Max advertising interval: 93.750 msec (0x0096)
Type: Non connectable undirected - ADV_NONCONN_IND (0x03)
Own address type: Random (0x01)
Direct address type: Public (0x00)
Direct address: 00:00:00:00:00:00 (OUI 00-00-00)
Channel map: 37, 38, 39 (0x07)
Filter policy: Allow Scan Request from Any, Allow Connect Request from Any (0x00)
"> HCI Event: Command Complete (0x0e) plen 4 #"4 [hci0] 4.275317
LE Set Advertising Parameters (0x08|0x0006) ncmd 1
Status: Invalid HCI Command Parameters (0x12)
@ MGMT Event: Advertising Removed (0x0024) plen 1 {0x0002} [hci0] 4.275367
Instance: 1
@ MGMT Event: Command Status (0x0002) plen 3 {0x0001} [hci0] 4.275380
Add Advertising (0x003e)
Status: Invalid Parameters (0x0d)
= bluetoothd: Failed to add advertisement: Invalid Parameters (0x0d) 4.276024
By the way, I would also like to ask how or where in the code do we have to set the data we want to advertise and it's format. I'm starting with this type of project in the raspberryPi and it's not being very easy to handle the c programming...
Thanks a lot in advance
I've tried to run the code in my raspberry Pi, but unfortunately it doesn't work properly. It's the same file as the one in github, and I'm afraid it's something related to directories or the bluetoothd version. I copy here the log obtained. (Ignore some " I had to write in order to keep the code integrity)
pi@FrambuesaPi:~ $ sudo btmon
Bluetooth monitor ver 5.50
= Note: Linux version 5.10.103-v7+ (armv7l) 0.972811
= Note: Bluetooth subsystem version 2.22 0.972824
= New Index: B8:27:EB:F3:EB:C5 (Primary,UART,hci0) [hci0] 0.972829
= Open Index: B8:27:EB:F3:EB:C5 [hci0] 0.972835
= Index Info: B8:27:EB:F.. (Cypress Semiconductor Corporation) [hci0] 0.972839
@ MGMT Open: bluetoothd (privileged) version 1.18 {0x0001} 0.972843
@ MGMT Open: btmon (privileged) version 1.18 {0x0002} 0.973232
@ MGMT Command: Add Advertising (0x003e) plen 27 {0x0001} [hci0] 4.271771
Instance: 1
Flags: 0x00000000
Duration: 0
Timeout: 0
Advertising data length: 16
16-bit Service UUIDs (complete): 3 entries
First Name (0x2a8a)
Last Name (0x2a90)
Email Address (0x2a87)
Service Data (UUID 0x2a8a): 5374616e
Scan response length: 0
@ MGMT Event: Advertising Added (0x0023) plen 1 {0x0002} [hci0] 4.271803
Instance: 1
< HCI Command: LE Set Random Address (0x08|0x0005) plen 6 #"1 [hci0] 4.271890
Address: 07:5B:83:7E:02:D3 (Non-Resolvable)
"> HCI Event: Command Complete (0x0e) plen 4 #"2 [hci0] 4.272221
LE Set Random Address (0x08|0x0005) ncmd 1
Status: Success (0x00)
< HCI Command: LE Set Advertising P.. (0x08|0x0006) plen 15 #"3 [hci0] 4.272268
Min advertising interval: 62.500 msec (0x0064)
Max advertising interval: 93.750 msec (0x0096)
Type: Non connectable undirected - ADV_NONCONN_IND (0x03)
Own address type: Random (0x01)
Direct address type: Public (0x00)
Direct address: 00:00:00:00:00:00 (OUI 00-00-00)
Channel map: 37, 38, 39 (0x07)
Filter policy: Allow Scan Request from Any, Allow Connect Request from Any (0x00)
"> HCI Event: Command Complete (0x0e) plen 4 #"4 [hci0] 4.275317
LE Set Advertising Parameters (0x08|0x0006) ncmd 1
Status: Invalid HCI Command Parameters (0x12)
@ MGMT Event: Advertising Removed (0x0024) plen 1 {0x0002} [hci0] 4.275367
Instance: 1
@ MGMT Event: Command Status (0x0002) plen 3 {0x0001} [hci0] 4.275380
Add Advertising (0x003e)
Status: Invalid Parameters (0x0d)
= bluetoothd: Failed to add advertisement: Invalid Parameters (0x0d) 4.276024
By the way, I would also like to ask how or where in the code do we have to set the data we want to advertise and it's format. I'm starting with this type of project in the raspberryPi and it's not being very easy to handle the c programming...
Thanks a lot in advance