Switching from Ad Hoc to access point mode and visa-versa

Discussion in 'Wireless Networking' started by Laery, Jan 19, 2005.

  1. Laery

    Laery Guest

    Hi,

    I've downloaded the evaluation version.
    Found in ethman en netui the sources needed to find the device name
    and switch the mode to and from accesspoint
    //switching the mode
    if(iSelection == 2)
    {
    // Computer-to-computer
    s_mode = Ndis802_11IBSS;
    }
    else if(iSelection == 1)
    {
    // infrastructure (access point) network
    s_mode = Ndis802_11Infrastructure;
    }
    else if(iSelection == 0)\
    {
    // Any network (access point preferred)
    s_mode = Ndis802_11AutoUnknown;
    }

    s_pWLanInfo->dwCtlFlags &= ~INTFCTL_CM_MASK;
    s_pWLanInfo->dwCtlFlags |= (((DWORD) s_mode) &
    INTFCTL_CM_MASK);

    FillPreferredLV(s_pWLanInfo);
    //get the devicename (I hope this will not change)
    while (ReadMsgQueue(
    hMsgQueue,
    &sDeviceNotification,
    sizeof(NDISUIO_DEVICE_NOTIFICATION),
    &dwBytesReturned,
    1,
    &dwFlags))
    {

    PTCHAR ptcDeviceName = NULL;

    // The device name should be in uppercase to query
    NdisUIO
    ptcDeviceName =
    _wcsdup(sDeviceNotification.ptcDeviceName);
    if (!ptcDeviceName)
    {
    DEBUGMSG(ZONE_ERROR, (TEXT("ETHMAN: Could not
    allocate memory for string \"%s\"\r\n"),
    sDeviceNotification.ptcDeviceName));
    continue;
    }

    _wcsupr(ptcDeviceName);

    I only hope it will work.

    Regards
    Laery
    -----------------
    Then you probably don't have enough information to make a serious
    attempt at
    this. You could download the evaluation version of PB and go from
    there...

    Paul T.

    "Laery" <> wrote in message
    news:...
    > Hi Paul,
    >
    > Thanks for the response, but I don't have platform builder only evc.
    >
    > Regards
    > Laery
    > ----------------------
    > Yes, you can do it via the Windows Zero Config API. When you call
    > WZCSetInterface(), you'd set the infrastructure mode field of the
    > structure
    > one way or the other.
    >
    > Paul T.
    >
    > "Laery" <> wrote in message
    > news:...
    >> Hi,
    >>
    >> I'm currently working on an application where a ppc2003 device

    prints
    >> to a mobile network printer using point-to-point wifi connection.
    >> (both fixed IP).
    >>
    >> For communication with the PC a FTP server is started on the

    handheld
    >> which is connected to a wifi-router which is connected to the pc

    using
    >> a cable.
    >>
    >> The problem:
    >> The printer is point-to-point (you cannot take the accesspoint with
    >> you on the street).
    >> The communication with the PC is using an access-point. (There can

    be
    >> several devices, more than 50, at an office location)
    >>
    >> Currently the switch in connection mode has to be done manually

    using
    >> the supplies driver GUI. Is there away to do it using an API from
    >> windows?
    >>
    >> Each handheld and printer has a unique IP but the same SSID and

    WEP.
    >> (same as the accesspoint)
    >>
    >> Or can something be done on the PC so that it connects to the
    >> terminals one by one.
    >>
    >> Regards
    >> Laery
    Laery, Jan 19, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Laery
    Replies:
    1
    Views:
    494
    Paul G. Tobey [eMVP]
    Jan 17, 2005
  2. Laery
    Replies:
    1
    Views:
    1,506
    Paul G. Tobey [eMVP]
    Jan 18, 2005
  3. Jon
    Replies:
    1
    Views:
    425
    =?Utf-8?B?QkFS?=
    Feb 22, 2005
  4. David Sudjiman
    Replies:
    0
    Views:
    1,059
    David Sudjiman
    Jun 8, 2006
  5. Replies:
    0
    Views:
    1,243
Loading...

Share This Page