3 namespace remote
{ namespace diku_mch
{
5 Mote::Mote( uint64_t p_macAddress
,
8 : SerialControl(p_ttyNum
),
9 macAddress(p_macAddress
),
14 printf("New mote %x at %s\n",(uint32_t)macAddress
,path
.c_str());
23 void Mote::invalidate()
28 void Mote::validate(std::string
& p_path
, uint16_t p_ttyNum
)
36 if ( p_ttyNum
!= ttyNum
)
38 Mote
* testmote
= new Mote(macAddress
,path
,p_ttyNum
);
40 bool testOpen
= testmote
->isOpen
;
45 printf("Changed ttynum from %u to %u\n",ttyNum
,p_ttyNum
);
48 sprintf(nstring
,Configuration::vm
["usbSerialDevicePath"].as
<std::string
>().c_str(),ttyNum
);
59 if (!isvalid
) printf("Mote at ttyUSB%u is invalid./n",ttyNum
);
62 uint64_t Mote::getMac()
67 uint16_t Mote::getTty()
72 const std::string
& Mote::getPath()