sonikarsh53
Posts: 1
Joined: Wed Jan 23, 2019 11:39 am

File sending using bluetooth using Obexctl using automate expect shell script.

Wed Jan 23, 2019 11:46 am

I want to send a file using bluetooth from one device to another device. For that i am using obex which has a command called 'obexctl'. It works as described in this ... Please Take a look into this Doc https://docs.ubuntu.com/core/en/stacks/ ... ding-files
Image
Image

This is how sending file works. For automating this process i have written one shell script using expect. which is as below.

Code: Select all

#!usr/bin/expect -f
   set address [lindex $argv 0]
   set prompt '#'
   spawn sudo obexctl
   sleep 1
   expect -re $prompt
   send "connect <MAC Address>"
   sleep 5
   send "quit"
but it didnt work. It doesnt fully execute that connect command.and exit the code. Please let me know if any of you know the solution.

Also posted question on Stackoverflow... https://stackoverflow.com/questions/543 ... s-expected

User avatar
Douglas6
Posts: 4874
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: File sending using bluetooth using Obexctl using automate expect shell script.

Wed Jan 23, 2019 4:20 pm

Are you able to send the file using obexctl manually at the command line?

Return to “General discussion”