What is the right path format in Bluetooth FileExchange Profile?

93 views Asked by At

I would like to implement a file browser via Bluetooth. I'm already able to connect and talk to an other computer. I would like to be able to list all available files under a specific path. I know I have to do as follows:

  1. Connect - to establish connection between 2 computers via BT
  2. SetPath - to choose a path I want
  3. Get - to get the list

I got stuck on 2. My data frame looks like that:

const char Setpath[] = {
 0x85, // SetPath
 0x00,0x15,// size of the msg
 0x02, // flag
 0x00, // const
 0xcb, // HI for ConnectionId header
 0x00,0x00,0x00,buff[11], // Connection ID
 0x01, // HI for Name header
 0x00,0x0B, // length of Name header
 0x2f,0x68,0x6f,0x6d,0x65,0x2f,0x00,0x00,  // /home/
  };

each time I send that packate, I got: C4 00 03, which means the file doesn't exsit.

So, how should the path look like to browse through Linux files?

1

There are 1 answers

9
ukBaz On

OBEX SetPath Command allows only for setting the current folder to the root, parent or a child folder. For example in order to set the folder to "/home", it would be necessary to apply SetPath twice: the first is necessary to change into "root" (although I think C4 00 03 indicates you are there already) and the second is necessary to change into "home". To put it another way: you can't do a path as you cannot use slash (/) anywhere in the information