2009-02-26 10:16:17     ttyBF0 communication with AT-Commands

Document created by Aaronwu Employee on Aug 14, 2013
Version 1Show Document
  • View in full screen mode

2009-02-26 10:16:17     ttyBF0 communication with AT-Commands

Izhar Eyal (ISRAEL)

Message: 70009   

 

Hi All,

 

We are using a bluetooth module. we have tested it alone with a terminal software and made sure it works just fine.

 

Now we are using the BF-561 to communicate with the bluetooth device in RS232.

 

AT-Commands are used. we used open("/dev/ttyBF0").

 

while we use gets() and fprintf() functions we can communicate ok with the bluetooth module.

 

but, we would like to use timeout and non-blocking functions, we tried using ncurses lib, using addstr(), getstr()

 

but we get wird responses. possibly because we switch the RS232 using logic as follows:

 

DSP <> Bluetooth module

 

DSP <> RS232 port to PC (used to see the linux prompt)

 

How would you recommend doing this?

 

Thanks

QuoteReplyEditDelete

 

 

2009-02-26 10:53:10     Re: ttyBF0 communication with AT-Commands

Mike Frysinger (UNITED STATES)

Message: 70011   

 

if you want non-blocking, then why dont you open the device with O_NONBLOCK ?  and if you want timeouts, use select()/poll()/epoll() to tell you when data is available.

Attachments

    Outcomes