by Rob Toulson and Tim Wilmshurst from textbook "Fast and Effective Embedded Systems Design: Applying the ARM mbed"

Dependencies:   mbed

main.cpp

Committer:
robt
Date:
2013-06-16
Revision:
0:0ed449e32cc1

File content as of revision 0:0ed449e32cc1:

/*Program Example 12.3: function to initialise paired Bluetooth connection with RN-41 modules
                                                                          */
void initialise_connection() {

  rn41.putc('$');    // Enter command mode
  rn41.putc('$');    //
  rn41.putc('$');    //
  wait(0.5);

  rn41.putc('C');    //
  rn41.putc(',');    // Send MAC address
  rn41.putc('0');    //
  rn41.putc('0');    //
  rn41.putc('0');    //
  rn41.putc('6');    //
  rn41.putc('6');    //
  rn41.putc('6');    //
  rn41.putc('0');    //
  rn41.putc('7');    //
  rn41.putc('A');    //
  rn41.putc('C');    //
  rn41.putc('C');    //
  rn41.putc('1');    //
  wait(0.5);

  rn41.putc('-');    // Exit command mode
  rn41.putc('-');    //
  rn41.putc('-');    //
  rn41.putc(0x0D);   //
  wait(0.5);
}