Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Mobile Development
  3. Mobile
  4. struct problem

struct problem

Scheduled Pinned Locked Moved Mobile
helpquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    illidan99
    wrote on last edited by
    #1

    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

    J E 2 Replies Last reply
    0
    • I illidan99

      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

      J Offline
      J Offline
      Joao Paulo Figueira
      wrote on last edited by
      #2

      What is the type of pp.device? Regards, João Paulo Figueira Embedded MVP

      I 1 Reply Last reply
      0
      • J Joao Paulo Figueira

        What is the type of pp.device? Regards, João Paulo Figueira Embedded MVP

        I Offline
        I Offline
        illidan99
        wrote on last edited by
        #3

        You 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

        1 Reply Last reply
        0
        • I illidan99

          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

          E Offline
          E Offline
          eli15021979
          wrote on last edited by
          #4

          Hi, 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

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups