IoServer.c
Go to the documentation of this file.
1 // IoServer.c
2 //
3 // History:
4 // 10/12/2017: Refactor IO server into separate task
5 /*
6 * Software License Agreement (BSD License)
7 *
8 * Copyright (c) 2013, Yaskawa America, Inc.
9 * Copyright (c) 2017, Delft University of Technology
10 * All rights reserved.
11 *
12 * Redistribution and use in binary form, with or without modification,
13 * is permitted provided that the following conditions are met:
14 *
15 * * Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * * Neither the name of the Yaskawa America, Inc., nor the names
19 * of its contributors may be used to endorse or promote products derived
20 * from this software without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
26 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.
33 */
34 
35 #include "MotoROS.h"
36 
37 //-----------------------
38 // Function implementation
39 //-----------------------
40 
41 //-----------------------------------------------------------------------
42 // Start the tasks for a new io server connection:
43 // - WaitForSimpleMsg: Task that waits to receive new SimpleMessage
44 //-----------------------------------------------------------------------
46 {
47  int connectionIndex;
48  int sockOpt;
49 
50  printf("Starting new connection to the IO Server\r\n");
51 
52 ATTEMPT_IO_CONNECTION:
53  //look for next available connection slot
54  for (connectionIndex = 0; connectionIndex < MAX_IO_CONNECTIONS; connectionIndex++)
55  {
56  if (controller->sdIoConnections[connectionIndex] == INVALID_SOCKET)
57  {
58  controller->sdIoConnections[connectionIndex] = sd;
59  break;
60  }
61  }
62 
63  if (connectionIndex == MAX_IO_CONNECTIONS)
64  {
65  if (Ros_MotionServer_HasDataInQueue(controller)) //another client is actively controlling motion; likely controlling I/O too
66  {
67  puts("IO server already connected... not accepting last attempt.");
68  mpClose(sd);
69  return;
70  }
71  else
72  {
73  puts("IO server already connected... closing old connection.");
74  Ros_IoServer_StopConnection(controller, 0); //close socket, cleanup resources, and delete tasks
75  goto ATTEMPT_IO_CONNECTION;
76  }
77  }
78 
79  //This timeout detection takes two hours. So, it's not terribly useful. But, it still serves a purpose
80  sockOpt = 1;
81  mpSetsockopt(sd, SOL_SOCKET, SO_KEEPALIVE, (char*)&sockOpt, sizeof(sockOpt));
82 
83  if (controller->tidIoConnections[connectionIndex] == INVALID_TASK)
84  {
85  printf("Creating new task: tidIoConnections (connectionIndex = %d)\n", connectionIndex);
86 
87  //start new task for this specific connection
88  controller->tidIoConnections[connectionIndex] = mpCreateTask(MP_PRI_TIME_NORMAL, MP_STACK_SIZE,
90  (int)controller, connectionIndex, 0, 0, 0, 0, 0, 0, 0, 0);
91 
92  if (controller->tidIoConnections[connectionIndex] != ERROR)
93  {
94  //set feedback signal indicating success
96  }
97  else
98  {
99  puts("Could not create new task in the IO server. Check robot parameters.");
100  mpClose(sd);
101  controller->sdIoConnections[connectionIndex] = INVALID_SOCKET;
102  controller->tidIoConnections[connectionIndex] = INVALID_TASK;
104  mpSetAlarm(8004, "MOTOROS FAILED TO CREATE TASK", 7);
105  return;
106  }
107  }
108 }
109 
110 
111 //-----------------------------------------------------------------------
112 // Close a connection along with all its associated task
113 //-----------------------------------------------------------------------
114 void Ros_IoServer_StopConnection(Controller* controller, int connectionIndex)
115 {
116  int tid;
117 
118  printf("Closing IO Server Connection\r\n");
119 
120  //close this connection
121  mpClose(controller->sdIoConnections[connectionIndex]);
122  //mark connection as invalid
123  controller->sdIoConnections[connectionIndex] = INVALID_SOCKET;
124 
125  // Stop message receiption task
126  tid = controller->tidIoConnections[connectionIndex];
127  controller->tidIoConnections[connectionIndex] = INVALID_TASK;
128  printf("IO Server Connection Closed\r\n");
129 
130  mpDeleteTask(tid);
131 }
132 
134 {
135  int minSize = sizeof(SmPrefix) + sizeof(SmHeader);
136  int expectedSize;
137 
138  switch (receiveMsg->header.msgType)
139  {
141  expectedSize = minSize + sizeof(SmBodyMotoReadIOBit);
142  break;
144  expectedSize = minSize + sizeof(SmBodyMotoWriteIOBit);
145  break;
147  expectedSize = minSize + sizeof(SmBodyMotoReadIOGroup);
148  break;
150  expectedSize = minSize + sizeof(SmBodyMotoWriteIOGroup);
151  break;
153  expectedSize = minSize + sizeof(SmBodyMotoReadIOMRegister);
154  break;
156  expectedSize = minSize + sizeof(SmBodyMotoWriteIOMRegister);
157  break;
158  default: //invalid message type
159  return -1;
160  }
161  return expectedSize;
162 }
163 
164 //-----------------------------------------------------------------------
165 // Checks the type of message and processes it accordingly
166 // Return -1=Failure; 0=Success; 1=CloseConnection;
167 //-----------------------------------------------------------------------
169 {
170  int ret = 0;
171  int invalidSubcode = 0;
172 
173  switch (receiveMsg->header.msgType)
174  {
175  //-----------------------
177  ret = Ros_IoServer_ReadIOBit(receiveMsg, replyMsg);
178  break;
179 
180  //-----------------------
182  ret = Ros_IoServer_WriteIOBit(receiveMsg, replyMsg);
183  break;
184 
185  //-----------------------
187  ret = Ros_IoServer_ReadIOGroup(receiveMsg, replyMsg);
188  break;
189 
190  //-----------------------
192  ret = Ros_IoServer_WriteIOGroup(receiveMsg, replyMsg);
193  break;
194 
195  //-----------------------
197  ret = Ros_IoServer_ReadIORegister(receiveMsg, replyMsg);
198  break;
199 
200  //-----------------------
202  ret = Ros_IoServer_WriteIORegister(receiveMsg, replyMsg);
203  break;
204 
205  //-----------------------
206  default:
207  printf("Invalid message type: %d\n", receiveMsg->header.msgType);
208  invalidSubcode = ROS_RESULT_INVALID_MSGTYPE;
209  break;
210  }
211 
212  // Check Invalid Case
213  if (invalidSubcode != 0)
214  {
215  Ros_SimpleMsg_IoReply(ROS_RESULT_INVALID, invalidSubcode, replyMsg);
216  ret = -1;
217  }
218 
219  return ret;
220 }
221 
222 //-----------------------------------------------------------------------
223 // Task that waits to receive new SimpleMessage and then processes it
224 //-----------------------------------------------------------------------
225 void Ros_IoServer_WaitForSimpleMsg(Controller* controller, int connectionIndex)
226 {
227  SimpleMsg receiveMsg;
228  SimpleMsg replyMsg;
229  int byteSize = 0, byteSizeResponse = 0;
230  int minSize = sizeof(SmPrefix) + sizeof(SmHeader);
231  int expectedSize;
232  int ret = 0;
233  BOOL bDisconnect = FALSE;
234  int partialMsgByteCount = 0;
235  BOOL bSkipNetworkRecv = FALSE;
236 
237  while(!bDisconnect) //keep accepting messages until connection closes
238  {
239  Ros_Sleep(0); //allow other tasks to run, if needed
240 
241  if (!bSkipNetworkRecv)
242  {
243  //Receive message from the PC
244  memset((&receiveMsg) + partialMsgByteCount, 0x00, sizeof(SimpleMsg) - partialMsgByteCount);
245  byteSize = mpRecv(controller->sdIoConnections[connectionIndex], (char*)((&receiveMsg) + partialMsgByteCount), sizeof(SimpleMsg) - partialMsgByteCount, 0);
246  if (byteSize <= 0)
247  break; //end connection
248 
249  byteSize += partialMsgByteCount;
250  partialMsgByteCount = 0;
251  }
252  else
253  {
254  byteSize = partialMsgByteCount;
255  partialMsgByteCount = 0;
256  bSkipNetworkRecv = FALSE;
257  }
258 
259  // Determine the expected size of the message
260  expectedSize = -1;
261  if (byteSize >= minSize)
262  {
263  expectedSize = Ros_IoServer_GetExpectedByteSizeForMessageType(&receiveMsg);
264 
265  if (expectedSize == -1)
266  {
267  printf("Unknown Message Received (%d)\r\n", receiveMsg.header.msgType);
269  }
270  else if (byteSize >= expectedSize) // Check message size
271  {
272  // Process the simple message
273  ret = Ros_IoServer_SimpleMsgProcess(&receiveMsg, &replyMsg);
274  if (ret != OK) //error during processing
275  {
276  bDisconnect = TRUE;
277  }
278  else if (byteSize > expectedSize) // Received extra data in single message
279  {
280  // Preserve the remaining bytes and treat them as the start of a new message
281  Db_Print("MessageReceived(%d bytes): expectedSize=%d, processing rest of bytes (%d, %d, %d)\r\n", byteSize, expectedSize, sizeof(receiveMsg), receiveMsg.body.jointTrajData.sequence, ((int*)((char*)&receiveMsg + expectedSize))[5]);
282  partialMsgByteCount = byteSize - expectedSize;
283  memmove(&receiveMsg, (char*)&receiveMsg + expectedSize, partialMsgByteCount);
284 
285  //Did I receive multiple full messages at once that all need to be processed before listening for new data?
286  if (partialMsgByteCount >= minSize)
287  {
288  expectedSize = Ros_IoServer_GetExpectedByteSizeForMessageType(&receiveMsg);
289  bSkipNetworkRecv = (partialMsgByteCount >= expectedSize); //does my modified receiveMsg buffer contain a full message to process?
290  }
291  }
292  else // All good
293  partialMsgByteCount = 0;
294  }
295  else // Not enough data to process the command
296  {
297  Db_Print("MessageReceived(%d bytes): expectedSize=%d\r\n", byteSize, expectedSize);
299  }
300  }
301  else // Didn't even receive a command ID
302  {
303  Db_Print("Unknown Data Received (%d bytes)\r\n", byteSize);
305  }
306 
307  //Send reply message
308  byteSizeResponse = mpSend(controller->sdIoConnections[connectionIndex], (char*)(&replyMsg), replyMsg.prefix.length + sizeof(SmPrefix), 0);
309  if (byteSizeResponse <= 0)
310  break; // Close the connection
311  }
312 
313  Ros_Sleep(50); // Just in case other associated task need time to clean-up. Don't if necessary... but it doesn't hurt
314 
315  //close this connection
316  Ros_IoServer_StopConnection(controller, connectionIndex);
317 }
318 
319 int Ros_IoServer_ReadIOBit(SimpleMsg* receiveMsg, SimpleMsg* replyMsg)
320 {
321  int apiRet;
322  MP_IO_INFO ioReadInfo;
323  USHORT ioValue = 0;
324 
325  //initialize memory
326  memset(replyMsg, 0x00, sizeof(SimpleMsg));
327 
328  // set prefix: length of message excluding the prefix
329  replyMsg->prefix.length = sizeof(SmHeader) + sizeof(SmBodyMotoReadIOBitReply);
330 
331  // set header information of the reply
334 
336  {
337  ioReadInfo.ulAddr = receiveMsg->body.readIOBit.ioAddress;
338  apiRet = mpReadIO(&ioReadInfo, &ioValue, QUANTITY_BIT);
339 
340  replyMsg->body.readIOBitReply.value = ioValue;
341  replyMsg->body.readIOBitReply.resultCode = (apiRet == OK) ? IO_RESULT_OK : IO_RESULT_READ_API_ERROR;
342  replyMsg->header.replyType = (apiRet == OK) ? ROS_REPLY_SUCCESS : ROS_REPLY_FAILURE;
343  }
344  else
345  {
346  replyMsg->body.readIOBitReply.value = 0;
348  replyMsg->header.replyType = ROS_REPLY_FAILURE;
349  }
350 
351  return OK; //keep connection alive regardless of any error code
352 }
353 
354 int Ros_IoServer_ReadIOGroup(SimpleMsg* receiveMsg, SimpleMsg* replyMsg)
355 {
356  int apiRet;
357  MP_IO_INFO ioReadInfo[8];
358  USHORT ioValue[8];
359  int resultValue = 0;
360  int i;
361 
362  //initialize memory
363  memset(replyMsg, 0x00, sizeof(SimpleMsg));
364 
365  // set prefix: length of message excluding the prefix
366  replyMsg->prefix.length = sizeof(SmHeader) + sizeof(SmBodyMotoReadIOGroupReply);
367 
368  // set header information of the reply
371 
373  {
374  for (i = 0; i < 8; i += 1)
375  {
376  ioReadInfo[i].ulAddr = (receiveMsg->body.readIOGroup.ioAddress * 10) + i;
377  }
378  apiRet = mpReadIO(ioReadInfo, ioValue, QUANTITY_BYTE);
379 
380  resultValue = 0;
381  for (i = 0; i < 8; i += 1)
382  {
383  resultValue |= (ioValue[i] << i);
384  }
385 
386  replyMsg->body.readIOGroupReply.value = resultValue;
388  replyMsg->header.replyType = (apiRet == OK) ? ROS_REPLY_SUCCESS : ROS_REPLY_FAILURE;
389  }
390  else
391  {
392  replyMsg->body.readIOGroupReply.value = 0;
394  replyMsg->header.replyType = ROS_REPLY_FAILURE;
395  }
396 
397  return OK; //keep connection alive regardless of any error code
398 }
399 
400 int Ros_IoServer_WriteIOBit(SimpleMsg* receiveMsg, SimpleMsg* replyMsg)
401 {
402  int apiRet;
403  MP_IO_DATA ioWriteData;
404  BOOL bAddressOk;
405  BOOL bValueOk;
406 
407  //initialize memory
408  memset(replyMsg, 0x00, sizeof(SimpleMsg));
409 
410  // set prefix: length of message excluding the prefix
411  replyMsg->prefix.length = sizeof(SmHeader) + sizeof(SmBodyMotoWriteIOBitReply);
412 
413  // set header information of the reply
416 
419 
420  if (bAddressOk && bValueOk)
421  {
422  ioWriteData.ulAddr = receiveMsg->body.writeIOBit.ioAddress;
423  ioWriteData.ulValue = receiveMsg->body.writeIOBit.ioValue;
424  apiRet = mpWriteIO(&ioWriteData, QUANTITY_BIT);
425 
427  replyMsg->header.replyType = (apiRet == OK) ? ROS_REPLY_SUCCESS : ROS_REPLY_FAILURE;
428  }
429  else
430  {
431  replyMsg->header.replyType = ROS_REPLY_FAILURE;
432 
433  if (!bAddressOk)
435  else if (!bValueOk)
437  }
438 
439  return OK; //keep connection alive regardless of any error code
440 }
441 
442 int Ros_IoServer_WriteIOGroup(SimpleMsg* receiveMsg, SimpleMsg* replyMsg)
443 {
444  int apiRet;
445  MP_IO_DATA ioWriteData[8];
446  int i;
447  BOOL bAddressOk;
448  BOOL bValueOk;
449 
450  //initialize memory
451  memset(replyMsg, 0x00, sizeof(SimpleMsg));
452 
453  // set prefix: length of message excluding the prefix
454  replyMsg->prefix.length = sizeof(SmHeader) + sizeof(SmBodyMotoWriteIOGroupReply);
455 
456  // set header information of the reply
459 
462 
463  if (bAddressOk && bValueOk)
464  {
465  for (i = 0; i < QUANTITY_BYTE; i += 1)
466  {
467  ioWriteData[i].ulAddr = (receiveMsg->body.writeIOGroup.ioAddress * 10) + i;
468  ioWriteData[i].ulValue = (receiveMsg->body.writeIOGroup.ioValue & (1 << i)) >> i;
469  }
470  apiRet = mpWriteIO(ioWriteData, QUANTITY_BYTE);
471 
473  replyMsg->header.replyType = (apiRet == OK) ? ROS_REPLY_SUCCESS : ROS_REPLY_FAILURE;
474  }
475  else
476  {
477  replyMsg->header.replyType = ROS_REPLY_FAILURE;
478 
479  if (!bAddressOk)
481  else if (!bValueOk)
483  }
484 
485  return OK; //keep connection alive regardless of any error code
486 }
487 
489 {
490  int apiRet;
491  MP_IO_INFO ioReadInfo;
492  USHORT ioValue = 0;
493 
494  //initialize memory
495  memset(replyMsg, 0x00, sizeof(SimpleMsg));
496 
497  // set prefix: length of message excluding the prefix
498  replyMsg->prefix.length = sizeof(SmHeader) + sizeof(SmBodyMotoReadIOMRegisterReply);
499 
500  // set header information of the reply
503 
504  if (receiveMsg->body.readRegister.registerNumber < 1000000)
505  receiveMsg->body.readRegister.registerNumber += 1000000;
506 
508  {
509  ioReadInfo.ulAddr = receiveMsg->body.readRegister.registerNumber;
510  apiRet = mpReadIO(&ioReadInfo, &ioValue, QUANTITY_BIT);
511 
512  replyMsg->body.readRegisterReply.value = ioValue;
514  replyMsg->header.replyType = (apiRet == OK) ? ROS_REPLY_SUCCESS : ROS_REPLY_FAILURE;
515  }
516  else
517  {
518  replyMsg->body.readRegisterReply.value = 0;
520  replyMsg->header.replyType = ROS_REPLY_FAILURE;
521  }
522 
523  return OK; //keep connection alive regardless of any error code
524 }
525 
527 {
528  int apiRet;
529  MP_IO_DATA ioWriteData;
530  BOOL bAddressOk;
531  BOOL bValueOk;
532 
533  //initialize memory
534  memset(replyMsg, 0x00, sizeof(SimpleMsg));
535 
536  // set prefix: length of message excluding the prefix
537  replyMsg->prefix.length = sizeof(SmHeader) + sizeof(SmBodyMotoWriteIOMRegisterReply);
538 
539  // set header information of the reply
542 
543  if (receiveMsg->body.writeRegister.registerNumber < 1000000)
544  receiveMsg->body.writeRegister.registerNumber += 1000000;
545 
548 
549  if (bAddressOk && bValueOk)
550  {
551  ioWriteData.ulAddr = receiveMsg->body.writeRegister.registerNumber;
552  ioWriteData.ulValue = receiveMsg->body.writeRegister.value;
553  apiRet = mpWriteIO(&ioWriteData, QUANTITY_BIT);
554 
556  replyMsg->header.replyType = (apiRet == OK) ? ROS_REPLY_SUCCESS : ROS_REPLY_FAILURE;
557  }
558  else
559  {
560  replyMsg->header.replyType = ROS_REPLY_FAILURE;
561 
562  if (!bAddressOk)
564  else if (!bValueOk)
566  }
567 
568  return OK; //keep connection alive regardless of any error code
569 }
570 
572 {
573  int mod = 0;
574 
575  if (size == IO_ACCESS_GROUP)
576  address *= 10;
577 
578  mod = address % 10;
579 
580  //last digit cannot end in 8 or 9, unless it is an M Register
581  if (size != IO_ACCESS_REGISTER && mod > 7)
582  return FALSE;
583 
584  if ((address >= GENERALINMIN && address <= GENERALINMAX) ||
585  (address >= GENERALOUTMIN && address <= GENERALOUTMAX) ||
586  (address >= EXTERNALINMIN && address <= EXTERNALINMAX) ||
587  (address >= NETWORKINMIN && address <= NETWORKINMAX) ||
588  (address >= NETWORKOUTMIN && address <= NETWORKOUTMAX) ||
589  (address >= EXTERNALOUTMIN && address <= EXTERNALOUTMAX) ||
590  (address >= SPECIFICINMIN && address <= SPECIFICINMAX) ||
591  (address >= SPECIFICOUTMIN && address <= SPECIFICOUTMAX) ||
592  (address >= IFPANELMIN && address <= IFPANELMAX) ||
593  (address >= AUXRELAYMIN && address <= AUXRELAYMAX) ||
594  (address >= CONTROLSTATUSMIN && address <= CONTROLSTATUSMAX) ||
595  (address >= PSEUDOINPUTMIN && address <= PSEUDOINPUTMAX) ||
596  (address >= REGISTERMIN && address <= REGISTERMAX_READ))
597  {
598  return TRUE;
599  }
600  else
601  return FALSE;
602 }
603 
605 {
606  int mod = 0;
607 
608  if (size == IO_ACCESS_GROUP)
609  address *= 10;
610 
611  mod = address % 10;
612 
613  //last digit cannot end in 8 or 9, unless it is an M Register
614  if (size != IO_ACCESS_REGISTER && mod > 7)
615  return FALSE;
616 
617  if ((address >= GENERALOUTMIN && address <= GENERALOUTMAX) ||
618  (address >= NETWORKINMIN && address <= NETWORKINMAX) ||
619  (address >= IFPANELMIN && address <= IFPANELMAX) ||
620  (address >= REGISTERMIN && address <= REGISTERMAX_WRITE))
621  {
622  return TRUE;
623  }
624  else
625  return FALSE;
626 }
627 
629 {
630  if (size == IO_ACCESS_REGISTER && value > 0xFFFF)
631  return FALSE;
632 
633  if (size == IO_ACCESS_GROUP && value > 0xFF)
634  return FALSE;
635 
636  if (size == IO_ACCESS_BIT && value > 1)
637  return FALSE;
638 
639  return TRUE;
640 }
void Ros_Controller_SetIOState(ULONG signal, BOOL status)
Definition: Controller.c:793
SmMsgType msgType
SmBodyMotoWriteIOGroup writeIOGroup
UINT32 ioValue
SmBodyMotoReadIOBit readIOBit
int sdIoConnections[MAX_IO_CONNECTIONS]
Definition: Controller.h:130
SmBodyMotoReadIOMRegisterReply readRegisterReply
SmBodyJointTrajPtFull jointTrajData
#define INVALID_TASK
Definition: Controller.h:68
#define IO_FEEDBACK_FAILURE
Definition: Controller.h:46
BOOL Ros_IoServer_IsValidWriteAddress(UINT32 address, IoAccessSize size)
Definition: IoServer.c:604
BOOL Ros_IoServer_IsValidWriteValue(UINT32 value, IoAccessSize size)
Definition: IoServer.c:628
int Ros_IoServer_WriteIORegister(SimpleMsg *receiveMsg, SimpleMsg *replyMsg)
Definition: IoServer.c:526
struct _SmHeader SmHeader
SmPrefix prefix
void Ros_IoServer_StartNewConnection(Controller *controller, int sd)
Definition: IoServer.c:45
IoAccessSize
Definition: IoServer.h:49
SmBodyMotoReadIOBitReply readIOBitReply
UINT32 value
int Ros_IoServer_WriteIOBit(SimpleMsg *receiveMsg, SimpleMsg *replyMsg)
Definition: IoServer.c:400
struct _SmBodyMotoWriteIOGroup SmBodyMotoWriteIOGroup
int Ros_IoServer_WriteIOGroup(SimpleMsg *receiveMsg, SimpleMsg *replyMsg)
Definition: IoServer.c:442
void Db_Print(char *msgFormat,...)
Definition: Controller.c:982
#define QUANTITY_BYTE
Definition: IoServer.h:274
int Ros_IoServer_SimpleMsgProcess(SimpleMsg *receiveMsg, SimpleMsg *replyMsg)
Definition: IoServer.c:168
struct _SmBodyMotoReadIOGroup SmBodyMotoReadIOGroup
void Ros_IoServer_StopConnection(Controller *controller, int connectionIndex)
Definition: IoServer.c:114
#define QUANTITY_BIT
Definition: IoServer.h:273
BOOL Ros_IoServer_IsValidReadAddress(UINT32 address, IoAccessSize size)
Definition: IoServer.c:571
void Ros_Sleep(float milliseconds)
Definition: Controller.c:999
struct _SmBodyMotoReadIOMRegister SmBodyMotoReadIOMRegister
int Ros_IoServer_ReadIORegister(SimpleMsg *receiveMsg, SimpleMsg *replyMsg)
Definition: IoServer.c:488
SmHeader header
void Ros_IoServer_WaitForSimpleMsg(Controller *controller, int connectionIndex)
Definition: IoServer.c:225
SmReplyType replyType
SmBodyMotoWriteIOBitReply writeIOBitReply
int Ros_SimpleMsg_IoReply(int result, int subcode, SimpleMsg *replyMsg)
SmCommType commType
#define IO_FEEDBACK_IOSERVERCONNECTED
Definition: Controller.h:45
int Ros_IoServer_ReadIOGroup(SimpleMsg *receiveMsg, SimpleMsg *replyMsg)
Definition: IoServer.c:354
struct _SmBodyMotoWriteIOMRegister SmBodyMotoWriteIOMRegister
int Ros_IoServer_GetExpectedByteSizeForMessageType(SimpleMsg *receiveMsg)
Definition: IoServer.c:133
struct _SmBodyMotoWriteIOBit SmBodyMotoWriteIOBit
SmBodyMotoWriteIOMRegister writeRegister
#define INVALID_SOCKET
Definition: Controller.h:67
BOOL Ros_MotionServer_HasDataInQueue(Controller *controller)
int tidIoConnections[MAX_IO_CONNECTIONS]
Definition: Controller.h:131
int Ros_IoServer_ReadIOBit(SimpleMsg *receiveMsg, SimpleMsg *replyMsg)
Definition: IoServer.c:319
SmBodyMotoWriteIOGroupReply writeIOGroupReply
SmBodyMotoReadIOGroup readIOGroup
struct _SmBodyMotoReadIOBit SmBodyMotoReadIOBit
SmBodyMotoReadIOMRegister readRegister
SmBodyMotoWriteIOMRegisterReply writeRegisterReply
SmBodyMotoReadIOGroupReply readIOGroupReply
#define MAX_IO_CONNECTIONS
Definition: Controller.h:57
SmBodyMotoWriteIOBit writeIOBit


motoman_driver
Author(s): Jeremy Zoss (Southwest Research Institute), Ted Miller (MotoROS) (Yaskawa Motoman), Eric Marcil (MotoROS) (Yaskawa Motoman)
autogenerated on Sat May 8 2021 02:27:43