struct problem
-
Hi, I have the following piece of code:
BD_ADDR direccion; direccion.LAP=0x19C4BB; //24bit LAP (Lower Address Part) direccion.UAP=0x37; //8bit UAP (Upper Address Part) direccion.NAP=0x0080; PORTEMUPortParams pp; memset (&pp, 0, sizeof(pp)); pp.channel = 0; pp.device = (BD_ADDR) direccion; //THEY'RE THE SAME TYPE!!WHY NOT RUN? pp.uiportflags = RFCOMM_PORT_FLAGS_REMOTE_DCB;
where BD_ADDR is a struct type according to MSDN web:#pragma pack(push, 1) typedef struct __bd_addr { union { struct { unsigned int LAP : 24; unsigned int UAP : 8; }; unsigned int SAP; }; unsigned short NAP; } BD_ADDR; #pragma pack(pop)
The problem is when I compile the project appears the next error that I dont understand: - Error in line """pp.device = (BD_ADDR) direccion;"""error C2679: binary '=' : no operator defined which takes a right-hand operand of type 'struct _BD_ADDR' (or there is no acceptable conversion)
Any suggestion?? Thanks. Regards, Javier -
Hi, I have the following piece of code:
BD_ADDR direccion; direccion.LAP=0x19C4BB; //24bit LAP (Lower Address Part) direccion.UAP=0x37; //8bit UAP (Upper Address Part) direccion.NAP=0x0080; PORTEMUPortParams pp; memset (&pp, 0, sizeof(pp)); pp.channel = 0; pp.device = (BD_ADDR) direccion; //THEY'RE THE SAME TYPE!!WHY NOT RUN? pp.uiportflags = RFCOMM_PORT_FLAGS_REMOTE_DCB;
where BD_ADDR is a struct type according to MSDN web:#pragma pack(push, 1) typedef struct __bd_addr { union { struct { unsigned int LAP : 24; unsigned int UAP : 8; }; unsigned int SAP; }; unsigned short NAP; } BD_ADDR; #pragma pack(pop)
The problem is when I compile the project appears the next error that I dont understand: - Error in line """pp.device = (BD_ADDR) direccion;"""error C2679: binary '=' : no operator defined which takes a right-hand operand of type 'struct _BD_ADDR' (or there is no acceptable conversion)
Any suggestion?? Thanks. Regards, JavierWhat is the type of
pp.device
? Regards, João Paulo Figueira Embedded MVP -
What is the type of
pp.device
? Regards, João Paulo Figueira Embedded MVPYou can look at: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcecomm5/html/wce50conCOMPortEmulationFacility.asp The type is BD_ADDR, they're the same type, so I don't understand the error. Maybe this help (the web above) is for Windows CE and I'm developing for Windows Mobile 2003 SE, with the following software: - Embedded Visual C++4 and his service pack 4. - Microsoft Pocket PC 2003 SDK. Could it be a problem? Can I develop an application for "making a virtual serial port" via bluetooth with this software? Thanks in advance. Regards, Javier
-
Hi, I have the following piece of code:
BD_ADDR direccion; direccion.LAP=0x19C4BB; //24bit LAP (Lower Address Part) direccion.UAP=0x37; //8bit UAP (Upper Address Part) direccion.NAP=0x0080; PORTEMUPortParams pp; memset (&pp, 0, sizeof(pp)); pp.channel = 0; pp.device = (BD_ADDR) direccion; //THEY'RE THE SAME TYPE!!WHY NOT RUN? pp.uiportflags = RFCOMM_PORT_FLAGS_REMOTE_DCB;
where BD_ADDR is a struct type according to MSDN web:#pragma pack(push, 1) typedef struct __bd_addr { union { struct { unsigned int LAP : 24; unsigned int UAP : 8; }; unsigned int SAP; }; unsigned short NAP; } BD_ADDR; #pragma pack(pop)
The problem is when I compile the project appears the next error that I dont understand: - Error in line """pp.device = (BD_ADDR) direccion;"""error C2679: binary '=' : no operator defined which takes a right-hand operand of type 'struct _BD_ADDR' (or there is no acceptable conversion)
Any suggestion?? Thanks. Regards, JavierHi, Maybe it's too late,but take a look on "Bt_api.h" and you will see that the type of pp.device is not BD_ADDR - but BT_ADDR. anyway - i have the same problem: i need to set up BlueTooth comunication between my PDA and another device and i want to use a virtual COM port,but i can't create one. my problems are: 1.i can't convert BD_ADDR to BT_ADDR. 2.i can't find the device dll. can you help me? Best regards, Eli