115 SG_LOG( SG_IO, SG_ALERT,
"This shouldn't happen, but the channel "
116 <<
"is already in use, ignoring" );
120 SG_LOG( SG_IO, SG_ALERT,
121 "Initializing ATC hardware, please wait ..." );
130 string lock0_file =
"/proc/atcflightsim/board0/lock";
131 string lock1_file =
"/proc/atcflightsim/board1/lock";
133 lock0_fd =
::open( lock0_file.c_str(), O_RDWR );
134 if ( lock0_fd == -1 ) {
135 SG_LOG( SG_IO, SG_ALERT,
"errno = " << errno );
137 snprintf( msg, 256,
"Error opening %s", lock0_file.c_str() );
142 lock1_fd =
::open( lock1_file.c_str(), O_RDWR );
143 if ( lock1_fd == -1 ) {
144 SG_LOG( SG_IO, SG_ALERT,
"errno = " << errno );
146 snprintf( msg, 256,
"Error opening %s", lock1_file.c_str() );
151 if ( !input0_path.isNull() ) {
155 if ( !input1_path.isNull() ) {
159 if ( !output0_path.isNull() ) {
161 output0->open( lock0_fd );
163 if ( !output1_path.isNull() ) {
165 output1->open( lock1_fd );
175 SG_LOG( SG_IO, SG_ALERT,
176 "Done initializing ATC hardware." );
185 bool board0_locked =
false;
186 bool board1_locked =
false;
188 if ( input0 != NULL || output0 != NULL ) {
191 board0_locked =
true;
195 if ( input1 != NULL || output1 != NULL ) {
198 board1_locked =
true;
208 if ( input0 != NULL && board0_locked ) {
211 if ( input1 != NULL && board1_locked ) {
225 SG_LOG( SG_NETWORK, SG_ALERT,
"Nasal: atcsim.update() failed!" );
229 if ( output0 != NULL && board0_locked ) {
232 if ( output1 != NULL && board1_locked ) {
236 if ( board0_locked ) {
239 if ( board1_locked ) {
static int fgATCMainRelease(int fd)
static int fgATCMainLock(int fd)