Document number 204911Version Rev. KIssue date 2016-10-11Sirius Breadboard User Manualwww.aacmicrotec.com Page 51 of 106errno valuesEBADF The file descriptor fd is not an open filedescriptorEINVAL Packet size is 0 or larger thanSPWN_MAX_PACKET_SIZE.5.8.2.5. int ioctl(…)Additional supported operations via POSIX Input/Output Control API.Argument name Type Direction Descriptionfd int in A file descriptor received at open.cmd int in Command defined in subchapter 5.8.2.5.1value void * in The value relating to command operation asdefined in subchapter 5.8.2.5.1.5.8.2.5.1. Mode settingSets the device into the given mode.Note! The mode setting affects the SpaceWire device and therefore all file descriptorsregistered to it.Return value Description0 Given mode was set- 1 see errno valueserrno valuesEINVAL Invalid mode.5.8.3. Usage5.8.3.1. RTEMS5.8.3.1.1. OverviewThe driver provides SpaceWire link setup and data transaction via the SpaceWire device.Each application that wants to communicate via the SpaceWire device must register with alogical address.The logical address is tied to a device number. To register to the device, the applicationmust use the predefined string SPWN_DEVICE_0_NAME_PREFIX with a chosen logicaladdress to register itself to the driver. See code example in subchapter 5.8.3.2. Theregistration is done by function open and deregistered by the function close.Command Type Direction DescriptionSPWN_IOCTL_MODE_SET uint32_t inSPWN_IOCTL_MODE_NORMAL for normalmode or SPWN_IOCTL_MODE_LOOPBACKfor loopback mode