Click here to Skip to main content
14,486,454 members

Linux Programming

 
QuestionMore advise wanted - how to run TWO loops ? Pin
Vaclav_13-Mar-20 15:23
MemberVaclav_13-Mar-20 15:23 
AnswerRe: More advise wanted - how to run TWO loops ? Pin
Peter_in_278013-Mar-20 18:31
professionalPeter_in_278013-Mar-20 18:31 
AnswerRe: More advise wanted - how to run TWO loops ? Pin
Richard MacCutchan13-Mar-20 23:09
mveRichard MacCutchan13-Mar-20 23:09 
AnswerRe: More advise wanted - how to run TWO loops ? Pin
Member 1477303714-Mar-20 20:42
MemberMember 1477303714-Mar-20 20:42 
QuestionSeeking professional advise... Pin
Vaclav_9-Mar-20 19:14
MemberVaclav_9-Mar-20 19:14 
AnswerRe: Seeking professional advise... Pin
k505410-Mar-20 4:29
Memberk505410-Mar-20 4:29 
GeneralRe: Seeking professional advise... Pin
Vaclav_10-Mar-20 5:12
MemberVaclav_10-Mar-20 5:12 
GeneralRe: Seeking professional advise... Pin
Richard MacCutchan10-Mar-20 5:48
mveRichard MacCutchan10-Mar-20 5:48 
QuestionUsing bluetooth connection asynchronously - C++ Pin
Vaclav_7-Mar-20 8:49
MemberVaclav_7-Mar-20 8:49 
QuestionReturn indicates failure , errno indicates status? Pin
Vaclav_6-Mar-20 6:06
MemberVaclav_6-Mar-20 6:06 
AnswerRe: Return indicates failure , errno indicates status? Pin
k50546-Mar-20 6:34
Memberk50546-Mar-20 6:34 
GeneralRe: Return indicates failure , errno indicates status? Pin
Vaclav_6-Mar-20 8:18
MemberVaclav_6-Mar-20 8:18 
GeneralRe: Return indicates failure , errno indicates status? Pin
Richard MacCutchan6-Mar-20 21:42
mveRichard MacCutchan6-Mar-20 21:42 
GeneralRe: Return indicates failure , errno indicates status? Pin
k50547-Mar-20 4:55
Memberk50547-Mar-20 4:55 
GeneralRe: Return indicates failure , errno indicates status? Pin
Vaclav_7-Mar-20 6:01
MemberVaclav_7-Mar-20 6:01 
GeneralRe: Return indicates failure , errno indicates status? Pin
Richard MacCutchan8-Mar-20 1:29
mveRichard MacCutchan8-Mar-20 1:29 
QuestionUsing ba2str fails - why ? Pin
Vaclav_4-Mar-20 4:59
MemberVaclav_4-Mar-20 4:59 
This is pretty simple function and compiles and works fine on X86.
Same usage , with same parameters passed to it, fails on ARM.

Description Resource Path Location Type
cannot convert ‘sockaddr_rc’ to ‘char*’ for argument ‘2’ to ‘int ba2str(const bdaddr_t*, char*)’ CBT.cpp /RPI_BT_CLIENT_ARM_/src/MODULES/M_CBT line 286 C/C++ Problem

I am at lost and could use some help to make it work.

It it helps, here is the code

for (i = 0; i < num_rsp; i++) {
            // convert bdaddr to array addr for print
    ba2str(&(ii + i)->bdaddr, addr);  FAILS HERE
    memset(name, 0, sizeof(name));
    if (hci_read_remote_name(dev_descriptor, &(ii + i)->bdaddr,
            sizeof(name), name, 0) < 0)
        strcpy(name, "[unknown]");
    printf("remote address  %s  remote name  %s\n", addr, name);
}


Bluetooth addresses are a 6-byte hex number similar to an Ethernet MAC address. BlueZ provides convenience functions for converting between a 6-byte string in the format 00:11:22:33:44:55 and the bdaddr_t struct. Here are the function prototypes:

    int ba2str(const bdaddr_t *ba, char *str);
    int str2ba(const char *str, bdaddr_t *ba);

The function ba2str converts from the internal bdaddr_t to a zero-terminated string (the str parameter should have at least 18 bytes), and str2ba provides the opposite conversion. The first example makes use of the ba2str function. 

AnswerRe: Using ba2str fails - why ? Pin
ZurdoDev4-Mar-20 5:14
mveZurdoDev4-Mar-20 5:14 
GeneralRe: Using ba2str fails - why ? Pin
Vaclav_4-Mar-20 5:36
MemberVaclav_4-Mar-20 5:36 
AnswerRe: Using ba2str fails - why ? Pin
ZurdoDev4-Mar-20 5:48
mveZurdoDev4-Mar-20 5:48 
GeneralRe: Using ba2str fails - why ? Pin
k50544-Mar-20 5:54
Memberk50544-Mar-20 5:54 
AnswerRe: Using ba2str fails - why ? Pin
k50544-Mar-20 5:20
Memberk50544-Mar-20 5:20 
AnswerRe: Using ba2str fails - why ? Pin
Richard MacCutchan4-Mar-20 5:34
mveRichard MacCutchan4-Mar-20 5:34 
GeneralRe: Using ba2str fails - why ? Pin
Vaclav_4-Mar-20 5:46
MemberVaclav_4-Mar-20 5:46 
GeneralRe: Using ba2str fails - why ? Pin
Richard MacCutchan4-Mar-20 6:16
mveRichard MacCutchan4-Mar-20 6:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.