Projet S5 Info / Mbed 2 deprecated Projet_S5

Dependencies:   mbed PowerControl

Fork of Projet_S5 by Jonathan Tousignant

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers mouvement.cpp Source File

mouvement.cpp

Go to the documentation of this file.
00001 #include "mouvement.h"
00002 
00003 Mouvement::Mouvement(short code, short code_envoie, string definition, bool h) :
00004     _code(code),
00005     _code_envoie(code_envoie),
00006     _definition(definition),
00007     hand(h)
00008 {
00009 }
00010 
00011 void Mouvement::sendData(Trame *trame)
00012 {
00013     char code[4];
00014     
00015     code[0] = hand ? 0x1 : 0x0;             // Hand
00016     code[1] = (_code_envoie >> 8) & 0xF;    // Code to send msb
00017     code[2] = (_code_envoie >> 4) & 0xF;    // Code to send
00018     code[3] = _code_envoie & 0xF;           // Code to send lsb
00019      
00020     const char destination[8] = {0};    // Destination Null
00021     
00022     trame->sendTransmitRequest(destination, code, sizeof(int)); // Trasmit code
00023 }