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. Linux Programming
  4. How to assign rfcomm ?

How to assign rfcomm ?

Scheduled Pinned Locked Moved Linux Programming
linuxhelptutorialquestion
6 Posts 3 Posters 8 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.
  • J Offline
    J Offline
    jana_hus
    wrote on last edited by
    #1

    Hello This is a follow-up on my previous post about “ln” commend. I am trying to link “dev/ttytUSB0” with “dev/rfcomm0”. I am doing something wrong and obviously not doing it in correct sequence or using Linux commands wrong. . I am using “ln” and “rfcomm” and get no response from both “ln” and “rfcomm”; nov5-6@nov56-desktop:~$ sudo ln /dev/ttyUSB0 /dev/rfcomm0 [sudo] password for nov5-6: nov5-6@nov56-desktop:~$ rfcomm –a nov5-6@nov56-desktop:~$ \ When I run “ln” again I get this: \nov5-6@nov56-desktop:~$ sudo ln -v /dev/ttyUSB0 /dev/rfcomm0 [sudo] password for nov5-6: ln: failed to create hard link '/dev/rfcomm0': File exists nov5-6@nov56-desktop:~$ If I use “rfcomm” it still returns nothing. nov5-6@nov56-desktop:~$ rfcomm –a nov5-6@nov56-desktop:~$ \ I am obviously missing something and I am asking the group for a solution. Thanks, any help with solving thius will be much appreciated

    K 1 Reply Last reply
    0
    • J jana_hus

      Hello This is a follow-up on my previous post about “ln” commend. I am trying to link “dev/ttytUSB0” with “dev/rfcomm0”. I am doing something wrong and obviously not doing it in correct sequence or using Linux commands wrong. . I am using “ln” and “rfcomm” and get no response from both “ln” and “rfcomm”; nov5-6@nov56-desktop:~$ sudo ln /dev/ttyUSB0 /dev/rfcomm0 [sudo] password for nov5-6: nov5-6@nov56-desktop:~$ rfcomm –a nov5-6@nov56-desktop:~$ \ When I run “ln” again I get this: \nov5-6@nov56-desktop:~$ sudo ln -v /dev/ttyUSB0 /dev/rfcomm0 [sudo] password for nov5-6: ln: failed to create hard link '/dev/rfcomm0': File exists nov5-6@nov56-desktop:~$ If I use “rfcomm” it still returns nothing. nov5-6@nov56-desktop:~$ rfcomm –a nov5-6@nov56-desktop:~$ \ I am obviously missing something and I am asking the group for a solution. Thanks, any help with solving thius will be much appreciated

      K Offline
      K Offline
      k5054
      wrote on last edited by
      #2

      It seems like you're still trying to connect /dev/rfcomm0 and /dev/ttyUSB0 together, so that a write to one will write to the other. As explained previously, that's not how a link works. Creating a link could be thought of as providing a different name for the same object. So for example, suppose you live at 42 Main Street. Creating a link is like adding the number 24 to your house. If you tell someone you live at 24 Main Street, or 42 Main Street, they find the same house, either way. As far as I know, there's no way to multiplex 2 files together. At least not in the Unix/Linux world. Maybe Windows does this? You do know that /dev in all but very old Linux systems is a virtual file system, and gets recreated every time you reboot? It's actually quite dynamic. For example as you plug-in and unplug USB devices, new /dev entries get added and removed as needed. My other suspicion is that you're trying to create /dev/rfcomm0 incorrectly. when you ls a device file, you get something like crw------- 1 root root 4, 1 Sep 23 08:17 /dev/tty1. The "c" at the start of the permissions string indicates its a character device, and 4, 1 indicate the MAJOR and MINOR device numbers. The major device number is, more or less, an index into the kernel's device driver table, and the minor is, once again more or less, the specific device to do I/O with. So in the case above, the MAJOR is 4, a console TTY device, and 1 is the tty number. Similarly /dev/tty2 has MAJOR,MINOR 4,2 etc. I'm guessing that /dev/rfcomm0 should be some sort of radio frequency communication device. As such it will have it's own MAJOR/MINOR assignments, almost certainly different from what a USB Serial device would have. Additionally, an rfcomm device will probably have its own set of ioctl calls that only make sense for that device. So think about that, what happens if you could link devices together what should happen when you try to send an ioctl to one of them that the other does not recognize, via the multiplex? Should it silently fail on one, but succeed on the other? What's the return value? How would you distinguish which device had rejected the IOCTL call. Worse, an ioctl looks like ioctl(int fd, unsigned long request, ...). So a request id (say 2) to one device might turn it on and to the other might put it in diagnostic mode. I repeat, it's not quite clear what you are trying to do. If you need a /dev/rfcomm0 device file to communicate to

      J 1 Reply Last reply
      0
      • K k5054

        It seems like you're still trying to connect /dev/rfcomm0 and /dev/ttyUSB0 together, so that a write to one will write to the other. As explained previously, that's not how a link works. Creating a link could be thought of as providing a different name for the same object. So for example, suppose you live at 42 Main Street. Creating a link is like adding the number 24 to your house. If you tell someone you live at 24 Main Street, or 42 Main Street, they find the same house, either way. As far as I know, there's no way to multiplex 2 files together. At least not in the Unix/Linux world. Maybe Windows does this? You do know that /dev in all but very old Linux systems is a virtual file system, and gets recreated every time you reboot? It's actually quite dynamic. For example as you plug-in and unplug USB devices, new /dev entries get added and removed as needed. My other suspicion is that you're trying to create /dev/rfcomm0 incorrectly. when you ls a device file, you get something like crw------- 1 root root 4, 1 Sep 23 08:17 /dev/tty1. The "c" at the start of the permissions string indicates its a character device, and 4, 1 indicate the MAJOR and MINOR device numbers. The major device number is, more or less, an index into the kernel's device driver table, and the minor is, once again more or less, the specific device to do I/O with. So in the case above, the MAJOR is 4, a console TTY device, and 1 is the tty number. Similarly /dev/tty2 has MAJOR,MINOR 4,2 etc. I'm guessing that /dev/rfcomm0 should be some sort of radio frequency communication device. As such it will have it's own MAJOR/MINOR assignments, almost certainly different from what a USB Serial device would have. Additionally, an rfcomm device will probably have its own set of ioctl calls that only make sense for that device. So think about that, what happens if you could link devices together what should happen when you try to send an ioctl to one of them that the other does not recognize, via the multiplex? Should it silently fail on one, but succeed on the other? What's the return value? How would you distinguish which device had rejected the IOCTL call. Worse, an ioctl looks like ioctl(int fd, unsigned long request, ...). So a request id (say 2) to one device might turn it on and to the other might put it in diagnostic mode. I repeat, it's not quite clear what you are trying to do. If you need a /dev/rfcomm0 device file to communicate to

        J Offline
        J Offline
        jana_hus
        wrote on last edited by
        #3

        Thank you for the reply. I am not sure HOW to reply without offending, however, I have specifically asked for assistance in analyzing the posted commands. I need to keep this short, my new OS does not do spell check... However - the second usage of "ln" failed because the /dev/rfcomm0 WAS already build....

        J 1 Reply Last reply
        0
        • J jana_hus

          Thank you for the reply. I am not sure HOW to reply without offending, however, I have specifically asked for assistance in analyzing the posted commands. I need to keep this short, my new OS does not do spell check... However - the second usage of "ln" failed because the /dev/rfcomm0 WAS already build....

          J Offline
          J Offline
          jana_hus
          wrote on last edited by
          #4

          I have found that relaying on responses / return values of SOME Linux commands is not necessary. Usually there are other commands where the result of the first command can be found, hence verified. For example "ln -v /dev/ttyUSB0 /dev/rfcomm0" result can be verified using "ls /dev/rf*"

          R 1 Reply Last reply
          0
          • J jana_hus

            I have found that relaying on responses / return values of SOME Linux commands is not necessary. Usually there are other commands where the result of the first command can be found, hence verified. For example "ln -v /dev/ttyUSB0 /dev/rfcomm0" result can be verified using "ls /dev/rf*"

            R Offline
            R Offline
            RichardM
            wrote on last edited by
            #5

            It may help if you provide a long listing of thos devices:

            ls -al /dev/tty*
            ls -al /dev/rfc*

            This would at least show how these two are currently assigned.

            J 1 Reply Last reply
            0
            • R RichardM

              It may help if you provide a long listing of thos devices:

              ls -al /dev/tty*
              ls -al /dev/rfc*

              This would at least show how these two are currently assigned.

              J Offline
              J Offline
              jana_hus
              wrote on last edited by
              #6

              Thank you. At present it is little overkill for my task using only one serial to Bluetooth connection. Eventually I will have multiple network connections...

              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