EV3RT CXX API Reference [English]
An RTOS-based development platform for LEGO Mindstorms EV3.
Bluetooth Class Reference

Class Bluetooth. API for working with bluetooth. More...

#include <ev3cxx_bluetooth.h>

Inheritance diagram for Bluetooth:
File

Public Member Functions

 Bluetooth ()
 Constructor of class Bluetooth. Don't open bluetooth port. For opening port call open().
 
 Bluetooth (bool_t open_bt)
 
 ~Bluetooth ()
 Destructor of class Bluetooth - DO NOTHING.
 
virtual bool_t open (const char *filename="", const char *mode="w+")
 Opening serial port on bluetooth. Params are not used. More...
 
virtual bool_t isOpen ()
 Return if is bluetooth port open. More...
 
bool_t isConnected ()
 It is checked whether Bluetooth (Serial Port Profile) is connected. More...
 
virtual int close ()
 Close the Bluetooth - DO NOTHING. More...
 
- Public Member Functions inherited from File
 File (const char *filename, const char *mode="w+")
 Constructor of class File. More...
 
virtual ~File ()
 Destructor of class File. Close the file if is open.
 
FILE * operator() ()
 Return file descriptor to open file or NULL.
 
int write (char ch)
 Write character to file. More...
 
int readChar ()
 Read character from file. More...
 
template<typename T >
std::enable_if< std::is_integral< T >::value, int >::type readNumber (T &val)
 Read number from file. More...
 
template<typename T >
std::enable_if< std::is_floating_point< T >::value, int >::type readNumber (T &val)
 
void rewind ()
 Set position of stream to the beginning. More...
 

Additional Inherited Members

- Protected Attributes inherited from File
FILE * m_filedesc
 file of this class
 

Detailed Description

Class Bluetooth. API for working with bluetooth.

Definition at line 22 of file ev3cxx_bluetooth.h.

Member Function Documentation

◆ close()

virtual int close ( )
inlinevirtual

Close the Bluetooth - DO NOTHING.

Returns
Everytime return zero.

Reimplemented from File.

Definition at line 79 of file ev3cxx_bluetooth.h.

79  {
80  return 0;
81  }

◆ isConnected()

bool_t isConnected ( )
inline

It is checked whether Bluetooth (Serial Port Profile) is connected.

Return values
trueConnected. It can communicate with the Bluetooth virtual serial port.
falseUnconnected.

Definition at line 70 of file ev3cxx_bluetooth.h.

70  {
71  return ev3_bluetooth_is_connected();
72  }

◆ isOpen()

virtual bool_t isOpen ( )
inlinevirtual

Return if is bluetooth port open.

Returns
If the bluetooth port is open return true, else false.

Reimplemented from File.

Definition at line 60 of file ev3cxx_bluetooth.h.

References File::m_filedesc.

60  {
61  return (m_filedesc != NULL);
62  }
FILE * m_filedesc
file of this class
Definition: ev3cxx_file.h:152

◆ open()

virtual bool_t open ( const char *  filename = "",
const char *  mode = "w+" 
)
inlinevirtual

Opening serial port on bluetooth. Params are not used.

Returns
Return true if is open, else false.

Reimplemented from File.

Definition at line 48 of file ev3cxx_bluetooth.h.

References File::m_filedesc.

Referenced by Bluetooth::Bluetooth().

48  {
49  if(m_filedesc == NULL) {
50  m_filedesc = ev3_serial_open_file(EV3_SERIAL_BT);
51  }
52  return (m_filedesc != NULL);
53  }
FILE * m_filedesc
file of this class
Definition: ev3cxx_file.h:152