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. General Programming
  3. C#
  4. Create a Socket from a MAC address?

Create a Socket from a MAC address?

Scheduled Pinned Locked Moved C#
csharpquestion
3 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.
  • C Offline
    C Offline
    carbon_golem
    wrote on last edited by
    #1

    I'm trying to use a bluetooth device as though it were a socket. I am aware that this can be done using WINSOCK and P/Invoke, but to be honest I really don't want to put myself through that just yet X|. With WMI I can get the MAC address that the BT Dongle is using, but can I use the MAC Address to create a socket with .NET? Scott P

    "Simplicity carried to the extreme becomes elegance."
    -Jon Franklin

    D _ 2 Replies Last reply
    0
    • C carbon_golem

      I'm trying to use a bluetooth device as though it were a socket. I am aware that this can be done using WINSOCK and P/Invoke, but to be honest I really don't want to put myself through that just yet X|. With WMI I can get the MAC address that the BT Dongle is using, but can I use the MAC Address to create a socket with .NET? Scott P

      "Simplicity carried to the extreme becomes elegance."
      -Jon Franklin

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Nope. The MAC address sits in the DataLink layer of the network stack, whereas sockets exist in the Network layer. You can't combine the two with any meaning. You'd have to resolve the MAC address to a Network layer address in order to create a socket.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007, 2008

      1 Reply Last reply
      0
      • C carbon_golem

        I'm trying to use a bluetooth device as though it were a socket. I am aware that this can be done using WINSOCK and P/Invoke, but to be honest I really don't want to put myself through that just yet X|. With WMI I can get the MAC address that the BT Dongle is using, but can I use the MAC Address to create a socket with .NET? Scott P

        "Simplicity carried to the extreme becomes elegance."
        -Jon Franklin

        _ Offline
        _ Offline
        _Superman_
        wrote on last edited by
        #3

        Microsoft has encapsulated bluetooth communciation in their socket layer as an extension to Winsock. There are a few APIs also provided that have the name BluetoothXXX. Winsock would be your best bet on this. Or you would have to go very low level as Dave mentioned.

        «_Superman_»

        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