[[2013b/MemberOnly/進行状況]] /* sm.h */ /* 送信と確認 */ sub sendmsg(int conn,int mb1,int mb2,string msg,string rps) { SendRemoteString(conn,mb1,msg); string rmsg = ""; while(rmsg == "") { ReceiveRemoteString(mb2,true,rmsg); TextOut(0,LCD_LINE1,"Wait until slave /n completes tasks..."); Wait(1000); } } sub btcheck(int conn) { while(!BluetoothStatus(conn) == NO_ERR) { ResetScreen(); TextOut(0,LCD_LINE1,"Something wrong"); Wait(1000); } } sub receive(int mb1,string rd) { string msg; while(msg != rd) { ReceiveRemoteString(mb1,true,msg); ResetScreen(); TextOut(0,LCD_LINE1,"Receiving..."); Wait(1000); } ResetScreen(); TextOut(0,LCD_LINE1,"I got it!!"); Wait(1000); } sub respond(int mb2,string reply) { SendResponseString(mb2,reply); ResetScreen(); TextOut(0,LCD_LINE1,"Responded"); Wait(1000); }