summaryrefslogtreecommitdiff
path: root/i/marvin/src/proto
diff options
context:
space:
mode:
Diffstat (limited to 'i/marvin/src/proto')
-rw-r--r--i/marvin/src/proto/proto.cc12
-rw-r--r--i/marvin/src/proto/proto.hh2
2 files changed, 8 insertions, 6 deletions
diff --git a/i/marvin/src/proto/proto.cc b/i/marvin/src/proto/proto.cc
index 1bc560f..216a345 100644
--- a/i/marvin/src/proto/proto.cc
+++ b/i/marvin/src/proto/proto.cc
@@ -59,7 +59,7 @@ Proto::sync(void)
// Récupération de la frame
while (getFrame())
{
-// log_ ("recv", Log::debug) << "frame" << currentFrame_;
+ log_ ("recv", Log::debug) << "frame" << currentFrame_;
// Si la frame est un aquittement
if(currentFrame_ == frameQueue_.front())
{
@@ -137,9 +137,11 @@ Proto::send (char command, const char *format, int a0, int a1,
/// Send a string of size number.
void
-Proto::send (char command, const std::string &str, int size, bool reliable)
+Proto::sendStr (char command, const char *str, int size, bool reliable)
{
Proto::Frame frame;
+
+ frame.command = command;
for (int compt = 0; compt < size; compt++)
newArgFrame (frame, 'b', str[compt]);
@@ -287,8 +289,8 @@ Proto::getFrame(void)
{
// On renvoie en mettant le compteur à 0, la commande sera
// renvoyer de retour à sync
-// log_("Erreur de reception", Log::debug)
-// << "commande inconnue" << "";
+ log_("Erreur de reception", Log::debug)
+ << "commande inconnue" << "";
tLastSend_ = 0;
revState_ = 0;
return false;
@@ -301,7 +303,7 @@ Proto::getFrame(void)
void
Proto::sendFrame(const Frame & frame)
{
-// log_ ("send", Log::debug) << "frame" << frame;
+ log_ ("send", Log::debug) << "frame" << frame;
// envoyer le bang
serial_.putchar('!');
diff --git a/i/marvin/src/proto/proto.hh b/i/marvin/src/proto/proto.hh
index 4e1f24c..8979a3d 100644
--- a/i/marvin/src/proto/proto.hh
+++ b/i/marvin/src/proto/proto.hh
@@ -84,7 +84,7 @@ class Proto : public NonCopyable
void send (char command, const char *format = "", int a0 = 0, int a1 = 0,
int a2 = 0, int a3 = 0, int a4 = 0, int a5 = 0, bool reliable = true);
/// Send a string of size number.
- void send (char command, const std::string &str, int size, bool reliable =
+ void sendStr (char command, const char *str, int size, bool reliable =
true);
/// permet d'envoyer un packet robert
void Proto::sendUnreliable (char command, const char *format, int a0,