638 #include <xtiocomm.h> 653 #if !defined( _TRY_IDENT_DECODE ) 654 #define _TRY_IDENT_DECODE 0 657 #if _TRY_IDENT_DECODE 662 #if defined( MBG_TGT_POSIX ) 664 #include <sys/socket.h> 666 #include <arpa/inet.h> 667 #elif defined( MBG_TGT_WIN32 ) 668 #if defined( _MSC_VER ) && ( _MSC_VER <= 1200 ) // at least up to VC6 669 #define VS_MISSING_IPHLPAPI 672 #if !defined( VS_MISSING_IPHLPAPI ) 673 #include <IPHlpApi.h> 678 #if defined( MBG_TGT_POSIX ) 683 #if defined( MBG_TGT_DOS ) 688 #include <mbgusbio.h> 691 #if _USE_USB_DIRECT_IO 696 #define DEBUG_SOCK_IO 1 697 #define DEBUG_FORCE_CONN 1 698 #define DEBUG_INIT_CONN 1 700 #define DEBUG_SOCK_IO 0 701 #define DEBUG_FORCE_CONN 0 702 #define DEBUG_INIT_CONN 0 705 #if defined( MBG_TGT_WIN32 ) && _USE_SOCKET_IO 706 #define _USE_WIN32_CONSOLE_CONTROL_HANDLER 1 708 #define _USE_WIN32_CONSOLE_CONTROL_HANDLER 0 712 #if !defined( MBGEXTIO_MSG_TIMEOUT_SERIAL ) 713 #define MBGEXTIO_MSG_TIMEOUT_SERIAL 2000 // [ms] 717 #if !defined( MBGEXTIO_POLL_TIMEOUT_SERIAL ) 718 #define MBGEXTIO_POLL_TIMEOUT_SERIAL 200 // [ms] 723 #if !defined( MBGEXTIO_MSG_TIMEOUT_USB ) 724 #define MBGEXTIO_MSG_TIMEOUT_USB 100 // [ms] 728 #if !defined( MBGEXTIO_POLL_TIMEOUT_USB ) 729 #define MBGEXTIO_POLL_TIMEOUT_USB MBGEXTIO_MSG_TIMEOUT_USB 770 return xtiocomm_get_cmd_name( cmd_code );
776 #if _USE_WIN32_CONSOLE_CONTROL_HANDLER 779 BOOL WINAPI mbgextio_on_console_event(
DWORD dwCtrlType )
781 switch ( dwCtrlType )
783 case CTRL_BREAK_EVENT:
785 case CTRL_CLOSE_EVENT:
786 case CTRL_SHUTDOWN_EVENT:
798 void mbgextio_set_console_control_handler(
void )
800 static int has_been_set;
804 SetConsoleCtrlHandler( mbgextio_on_console_event, TRUE );
810 #endif // _USE_WIN32_CONSOLE_CONTROL_HANDLER 838 switch ( mdev_info->prod_id )
870 #if 0 // //### TODO check these device, they probably do support binary 885 fprintf( stderr,
"Checking for legacy USB device %04X:%04X: %s, code %i\n",
886 mdev_info->ven_id, mdev_info->ven_id, model_name, model_code );
894 memset( p_ri, 0,
sizeof( *p_ri ) );
905 #endif // _USE_USB_IO 927 memset( p_xdf, 0,
sizeof( *p_xdf ) );
985 #if _USE_WIN32_CONSOLE_CONTROL_HANDLER 986 mbgextio_set_console_control_handler();
996 return dev_open_fail_close( rc, ppmctl, caller_ppmctl );
998 return dev_open_finish( rc, *ppmctl, caller_ppmctl );
1015 int set_socket_blocking_mode(
MBG_SOCK_FD sock_fd,
int blocking )
1025 #if defined( MBG_TGT_WIN32 ) 1027 u_long mode = blocking ? 0 : 1;
1029 rc = ioctlsocket( sock_fd, FIONBIO, &mode );
1037 #elif defined( MBG_TGT_POSIX ) 1039 int val = fcntl( sock_fd, F_GETFL, 0 );
1052 rc = fcntl( sock_fd, F_SETFL, val );
1087 socklen_t so_err_sz =
sizeof( so_err );
1088 int rc = getsockopt( sock_fd, SOL_SOCKET, SO_ERROR, (
char *) &so_err, &so_err_sz );
1096 if ( so_err_sz !=
sizeof( so_err ) )
1098 fprintf( stderr,
"Warning: getsockopt option size changed in get_sock_error: %li -> %li",
1099 (
long)
sizeof( so_err ), (
long) so_err_sz );
1106 #if defined( MBG_TGT_WIN32 ) 1108 #elif defined( MBG_TGT_POSIX ) 1111 #error This function is not supported for this target. 1140 int wait_nonblocking_socket_ready(
MBG_SOCK_FD sock_fd,
long timeout_msec )
1146 #if ( 1 || defined( MBG_TGT_WIN32 ) ) //### TODO 1147 #define USE_EXCEPT_FDS_WITH_CONNECT 1 1149 #define USE_EXCEPT_FDS_WITH_CONNECT 0 1153 #if USE_EXCEPT_FDS_WITH_CONNECT 1157 struct timeval tv_timeout;
1160 mbg_msec_to_timeval( timeout_msec, &tv_timeout );
1162 FD_ZERO( &write_fds );
1163 FD_SET( sock_fd, &write_fds );
1165 #if defined( MBG_TGT_WIN32 ) 1175 #if USE_EXCEPT_FDS_WITH_CONNECT 1176 FD_ZERO( &except_fds );
1177 FD_SET( sock_fd, &except_fds );
1178 rc = select( max_fd + 1, NULL, &write_fds, &except_fds, &tv_timeout );
1180 rc = select( max_fd + 1, NULL, &write_fds, NULL, &tv_timeout );
1192 fprintf( stderr,
"select timed out in wait_nonblocking_socket_ready" );
1198 #if USE_EXCEPT_FDS_WITH_CONNECT 1201 if ( FD_ISSET( sock_fd, &except_fds ) )
1203 rc = get_sock_error( sock_fd );
1211 if ( !FD_ISSET( sock_fd, &write_fds ) )
1214 fprintf( stderr,
"write_fd is not set after select in wait_nonblocking_socket_ready" );
1220 #if defined( MBG_TGT_LINUX ) 1226 rc = get_sock_error( sock_fd );
1238 #if defined( MBG_TGT_WIN32 ) 1248 void deinit_winsock(
void )
1259 int check_init_winsock(
void )
1261 static bool wsa_init;
1266 WORD wVersionRequested = MAKEWORD( 2, 2 );
1269 rc = WSAStartup( wVersionRequested, &wsaData );
1277 atexit( deinit_winsock );
1285 #endif // defined( MBG_TGT_WIN32 ) 1303 #if defined( VS_MISSING_IPHLPAPI ) 1306 struct sockaddr_in src_addr = { 0 };
1307 struct sockaddr_in bcast_addr = { 0 };
1308 struct sockaddr_in global_bcast_addr = { 0 };
1312 const uint32_t query = htonl( MBG_LAN_REQUEST_CONFIG );
1313 socklen_t addr_len =
sizeof (
struct sockaddr_in );
1314 struct in_addr src_in_addr = { 0 };
1315 struct in_addr broad_in_addr = { 0 };
1316 struct timeval select_timeout;
1326 #if defined( MBG_TGT_POSIX ) 1328 struct ifaddrs *ifaddr = NULL, *ifa;
1330 #elif defined( MBG_TGT_WIN32 ) 1332 PIP_ADAPTER_ADDRESSES pAdptAddrs, pAdptAddr;
1333 PIP_ADAPTER_UNICAST_ADDRESS pUnicastAddr;
1334 ULONG flags = GAA_FLAG_SKIP_ANYCAST | GAA_FLAG_SKIP_MULTICAST | GAA_FLAG_SKIP_DNS_SERVER;
1335 unsigned long adptAddrsBuflen =
sizeof( IP_ADAPTER_ADDRESSES );
1340 global_bcast_addr.sin_family = AF_INET;
1341 global_bcast_addr.sin_addr.s_addr = htonl( INADDR_BROADCAST );
1342 global_bcast_addr.sin_port = htons( MBG_LAN_UDP_BROADCAST_PORT );
1344 bcast_addr.sin_family = AF_INET;
1345 bcast_addr.sin_port = htons( MBG_LAN_UDP_BROADCAST_PORT );
1347 #if defined( MBG_TGT_POSIX ) 1349 if ( getifaddrs( &ifaddr ) == 0 )
1351 for ( ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next )
1353 if ( ifa->ifa_addr && ( ifa->ifa_addr->sa_family == AF_INET ) )
1355 src_in_addr.s_addr = ( (
struct sockaddr_in *) ifa->ifa_addr )->sin_addr.s_addr;
1357 if ( ifa->ifa_broadaddr )
1358 broad_in_addr = ( (
struct sockaddr_in *) ifa->ifa_broadaddr )->sin_addr;
1360 #elif defined( MBG_TGT_WIN32 ) 1362 rc = check_init_winsock();
1366 pAdptAddrs = (PIP_ADAPTER_ADDRESSES) malloc(
sizeof( IP_ADAPTER_ADDRESSES ) );
1371 rc = GetAdaptersAddresses( AF_INET, flags, NULL, pAdptAddrs, &adptAddrsBuflen );
1372 if ( rc == ERROR_BUFFER_OVERFLOW )
1375 pAdptAddrs = (PIP_ADAPTER_ADDRESSES) malloc( adptAddrsBuflen );
1378 rc = GetAdaptersAddresses( AF_INET, flags, NULL, pAdptAddrs, &adptAddrsBuflen );
1381 if ( rc == NO_ERROR )
1383 for ( pAdptAddr = pAdptAddrs; pAdptAddr != NULL; pAdptAddr = pAdptAddr->Next )
1385 if ( pAdptAddr->OperStatus != IfOperStatusUp )
1388 for ( pUnicastAddr = pAdptAddr->FirstUnicastAddress; pUnicastAddr != NULL; pUnicastAddr = pUnicastAddr->Next )
1390 if ( pUnicastAddr->Address.lpSockaddr->sa_family != AF_INET )
1393 src_in_addr.s_addr = ( (
struct sockaddr_in *) pUnicastAddr->Address.lpSockaddr )->sin_addr.s_addr;
1395 broad_in_addr = src_in_addr;
1396 for( prefix = pUnicastAddr->OnLinkPrefixLength; prefix < 32; prefix++ )
1397 broad_in_addr.s_addr |= ( 1
UL << prefix );
1401 if ( ntohl( src_in_addr.s_addr ) == INADDR_LOOPBACK )
1404 sock = socket( AF_INET, SOCK_DGRAM, IPPROTO_UDP );
1408 mbg_tmo_get_time( &t_end );
1409 mbg_tmo_add_ms( &t_end, timeout_ms );
1411 src_addr.sin_family = AF_INET;
1412 src_addr.sin_addr.s_addr = src_in_addr.s_addr;
1414 bcast_addr.sin_addr.s_addr = broad_in_addr.s_addr;
1416 if ( ( setsockopt( sock, SOL_SOCKET, SO_BROADCAST, (
const char*) &opt,
sizeof( opt ) ) == 0 ) &&
1417 ( bind( sock, (
const struct sockaddr *) &src_addr, addr_len ) == 0 ) )
1419 if ( ( sendto( sock, (
char *) &query,
sizeof( query ), 0, (
struct sockaddr *) &global_bcast_addr, addr_len ) ==
sizeof( query ) ) &&
1420 ( sendto( sock, (
char *) &query,
sizeof( query ), 0, (
struct sockaddr *) &bcast_addr, addr_len ) ==
sizeof( query ) ) )
1425 FD_SET( sock, &socks );
1427 mbg_tmo_get_time( &t_now );
1428 if ( mbg_tmo_time_is_after( &t_now, &t_end ) )
1430 mbg_msec_to_timeval( mbg_tmo_time_diff_ms( &t_end, &t_now ), &select_timeout );
1432 addr_len =
sizeof(
struct sockaddr_in );
1438 if( select( (
int) ( sock + 1 ), &socks, NULL, NULL, &select_timeout ) > 0 )
1440 if( recvfrom( sock, (
char *) &buf,
sizeof( buf ), 0, (
struct sockaddr *) &src_addr, &addr_len ) >= (ssize_t)
sizeof( buf ) )
1442 if( ( ntohl( buf.command ) == MBG_LAN_RESPOND_CONFIG ) &&
1443 ( ( ntohs( buf.channel_0.own_tcp_port ) == LAN_XPT_PORT ) ||
1444 ( buf.channel_0.own_tcp_port == LAN_XPT_PORT ) ||
1445 ( ntohs( buf.channel_0.own_tcp_port ) == LAN_SSH_PORT ) ||
1446 ( buf.channel_0.own_tcp_port == LAN_SSH_PORT ) ) )
1452 tmp_entry = list_head;
1453 while( tmp_entry && !found )
1455 if( tmp_entry->config.ip_address == ntohl( src_addr.sin_addr.s_addr ) )
1457 tmp_entry = tmp_entry->next;
1465 curr_entry->next = (
MBG_LAN_DEV_LIST *) malloc(
sizeof( *curr_entry->next ) );
1466 if ( !curr_entry->next )
1469 goto cleanup_and_return;
1471 curr_entry = curr_entry->next;
1479 goto cleanup_and_return;
1481 list_head = curr_entry;
1484 memset( curr_entry, 0,
sizeof( *curr_entry ) );
1485 curr_entry->config = buf;
1486 curr_entry->config.ip_address = ntohl( src_addr.sin_addr.s_addr );
1499 goto cleanup_and_return;
1505 goto cleanup_and_return;
1508 #if defined( MBG_TGT_POSIX ) 1510 shutdown( sock, SHUT_RDWR );
1513 #elif defined( MBG_TGT_WIN32 ) 1515 shutdown( sock, SD_BOTH );
1516 closesocket( sock );
1524 goto cleanup_and_return;
1534 #if defined( MBG_TGT_POSIX ) 1537 freeifaddrs( ifaddr );
1541 shutdown( sock, SHUT_RDWR );
1545 #elif defined( MBG_TGT_WIN32 ) 1552 shutdown( sock, SD_BOTH );
1553 closesocket( sock );
1589 next_entry = list->next;
1607 int socket_init(
MBG_MSG_CTL *pmctl,
const char *host )
1610 #if _USE_SSH_ENCRYPTION 1613 struct addrinfo *pinfo = NULL;
1615 #if defined( MBG_TGT_WIN32 ) 1616 rc = check_init_winsock( );
1622 if ( pmctl->
st.sockio.use_ssh )
1624 #if _USE_SSH_ENCRYPTION 1625 long tout = 5000 * 1000;
1626 int state, port = LAN_SSH_PORT;
1630 ssh_data->session = ssh_new();
1631 if ( ssh_data->session == NULL )
1637 ssh_options_set( ssh_data->session, SSH_OPTIONS_HOST, host );
1638 ssh_options_set( ssh_data->session, SSH_OPTIONS_PORT, &port );
1639 ssh_options_set( ssh_data->session, SSH_OPTIONS_TIMEOUT_USEC, &tout );
1641 if ( ssh_connect( ssh_data->session ) != SSH_OK )
1643 if( ssh_get_error_code( ssh_data->session ) == SSH_REQUEST_DENIED )
1650 state = ssh_is_server_known( ssh_data->session );
1653 case SSH_SERVER_KNOWN_OK:
1658 case SSH_SERVER_KNOWN_CHANGED:
1659 case SSH_SERVER_FOUND_OTHER:
1660 case SSH_SERVER_FILE_NOT_FOUND:
1661 case SSH_SERVER_NOT_KNOWN:
1663 if ( ssh_data->key_prompt )
1664 rc = ssh_data->key_prompt( ssh_data, state );
1670 default:
goto out_close;
1673 if ( ssh_data->login_prompt )
1675 rc = ssh_data->login_prompt( ssh_data, login_rc );
1680 ssh_data->channel = ssh_channel_new( ssh_data->session );
1681 if ( ssh_data->channel == NULL )
1687 if ( ssh_channel_open_session( ssh_data->channel ) != SSH_OK )
1693 rc = ssh_channel_read( ssh_data->channel, &tmp,
sizeof( tmp ), 0 );
1700 socket_close(pmctl);
1718 struct sockaddr_in addr;
1719 struct addrinfo hints;
1720 struct sockaddr_in *paddr;
1721 const struct sockaddr *p;
1724 if ( inet_pton( AF_INET, host, &addr.sin_addr ) == 1 )
1729 memset( &hints, 0,
sizeof( hints ) );
1730 hints.ai_family = AF_INET;
1731 hints.ai_socktype = SOCK_STREAM;
1732 hints.ai_protocol = IPPROTO_TCP;
1734 switch ( getaddrinfo( host, NULL, &hints, &pinfo ) )
1744 #if defined( EAI_NODATA ) && ( EAI_NODATA != EAI_NONAME ) 1747 #if defined( EAI_ADDRFAMILY ) 1748 case EAI_ADDRFAMILY:
1750 #if defined( EAI_FAMILY ) 1775 addr.sin_addr = ( (
struct sockaddr_in* )pinfo->ai_addr )->sin_addr;
1779 pmctl->
st.sockio.sockfd = socket( PF_INET, SOCK_STREAM, 0 );
1790 rc = set_socket_blocking_mode( pmctl->
st.sockio.sockfd, 0 );
1797 paddr = &pmctl->
st.sockio._addr;
1798 memset( paddr, 0,
sizeof( *paddr ) );
1800 paddr->sin_addr = addr.sin_addr;
1801 paddr->sin_family = AF_INET;
1802 paddr->sin_port = htons( LAN_XPT_PORT );
1804 p = (
const struct sockaddr *) paddr;
1805 sz =
sizeof( *paddr );
1807 rc = connect( pmctl->
st.sockio.sockfd, p, sz );
1818 #if defined( MBG_TGT_WIN32 ) 1819 DWORD wsa_err = WSAGetLastError();
1822 if ( wsa_err != WSAEWOULDBLOCK )
1828 int posix_errno = errno;
1831 if ( ( posix_errno != EINPROGRESS ) && ( posix_errno != EALREADY ) )
1838 rc = wait_nonblocking_socket_ready( pmctl->
st.sockio.sockfd, 1500 );
1845 rc = set_socket_blocking_mode( pmctl->
st.sockio.sockfd, 1 );
1847 pmctl->
st.sockio.p_addr = &pmctl->
st.sockio._addr;
1848 pmctl->
st.sockio.addrlen =
sizeof( pmctl->
st.sockio._addr );
1856 socket_close( pmctl );
1860 freeaddrinfo( pinfo );
1884 const char *old_passwd,
const char *new_passwd )
1887 SECU_SETTINGS *pss = &pmctl->secu_settings;
1895 memset( pss, 0,
sizeof *pss );
1896 strncpy_safe( pss->password, old_passwd,
sizeof( pss->password ) );
1902 if ( strlen( new_passwd ) > 0 )
1903 strncpy_safe( pss->new_password, new_passwd,
sizeof( pss->new_password ) );
1905 pss->flags |= MSK_FLAG_CHANGE_PASSWORD;
1969 int rc = sendto( pmctl->
st.sockio.sockfd, buf, len, 0,
1970 (
const struct sockaddr *)pmctl->
st.sockio.p_addr,
1971 pmctl->
st.sockio.addrlen );
1975 if ( (
size_t)rc != len )
2008 struct timeval tv_timeout;
2013 mbg_msec_to_timeval( pmctl->
st.sockio.poll_timeout, &tv_timeout );
2016 FD_SET( pmctl->
st.sockio.sockfd, &fds );
2018 #if defined( MBG_TGT_WIN32 ) 2025 max_fd = pmctl->
st.sockio.sockfd;
2028 rc = select( max_fd + 1, &fds, NULL, NULL, &tv_timeout );
2038 return recv( pmctl->
st.sockio.sockfd, buf, len, 0 );
2064 int rc = alloc_msg_ctl( &pmctl );
2067 return dev_open_finish( rc, pmctl, ppmctl );
2072 rc = socket_init( pmctl, host );
2075 return dev_open_fail_free( rc, &pmctl, ppmctl );
2078 MBGEXTIO_POLL_TIMEOUT_SOCKET );
2083 return dev_open_fail_close( rc, &pmctl, ppmctl );
2090 #if _USE_SSH_ENCRYPTION 2117 ssh_data = __mbg_get_pmctl_ssh_data( pmctl );
2120 rc = ssh_channel_write( ssh_data->channel, buf, len );
2125 if ( (
size_t)rc != len )
2159 SSH_DATA *ssh_data = __mbg_get_pmctl_ssh_data( pmctl );
2160 struct timeval tv_timeout;
2161 ssh_channel chans[2];
2164 mbg_msec_to_timeval( pmctl->
st.sockio.poll_timeout, &tv_timeout );
2166 chans[0] = ssh_data->channel;
2175 ssh_rc = ssh_channel_select( chans, NULL, NULL, &tv_timeout );
2176 if ( ssh_rc == SSH_OK )
2178 if ( chans[0] != ssh_data->channel )
2182 ssh_rc = ssh_channel_read_nonblocking( ssh_data->channel, buf, len, 0 );
2193 case SSH_EOF:
return 0;
2242 int rc = alloc_msg_ctl( &pmctl );
2245 return dev_open_finish( rc, pmctl, ppmctl );
2247 pmctl->
st.sockio.use_ssh = 1;
2250 pmctl->
st.sockio.get_ssh_data = mbgextio_get_ssh_data;
2254 rc = socket_init( pmctl, host );
2257 return dev_open_fail_free( rc, &pmctl, ppmctl );
2260 MBGEXTIO_POLL_TIMEOUT_SOCKET );
2267 #endif // _USE_SOCKET_IO 2275 uint32_t baud_rate,
const char *framing )
2278 int rc = alloc_msg_ctl( &pmctl );
2281 return dev_open_finish( rc, pmctl, ppmctl );
2286 return dev_open_fail_free( rc, &pmctl, ppmctl );
2294 return dev_open_fail_close( rc, &pmctl, ppmctl );
2296 return dev_open_finish( rc, pmctl, ppmctl );
2328 uint32_t baud_rate,
const char *framing )
2331 int rc = alloc_msg_ctl( &pmctl );
2334 return dev_open_finish( rc, pmctl, ppmctl );
2339 return dev_open_fail_free( rc, &pmctl, ppmctl );
2347 return dev_open_fail_close( rc, &pmctl, ppmctl );
2379 int len = (int) strlen( cmd_str );
2394 #ifdef MBG_TGT_WIN32 2400 Sleep( ( ( 10 * 1000 * len ) / baud_rate ) + 1 );
2406 #if defined( MBG_TGT_WIN32 ) 2408 #elif defined( MBG_TGT_DOS ) 2419 if( ( baud_rate == MBG_DEFAULT_BAUDRATE ) && ( strcmp( framing,
MBG_DEFAULT_FRAMING ) == 0 ) )
2424 len = ( int )strlen( cmd_str );
2436 #endif // _USE_SERIAL_IO 2440 #if _USE_SERIAL_IO_FTDI 2452 return pmctl->
st.ftdi.port_handle;
2483 MBG_MSG_CTL **ppmctl, uint32_t baud_rate,
const char *framing )
2492 int rc = alloc_msg_ctl( &pmctl );
2495 return dev_open_finish( rc, pmctl, ppmctl );
2497 status = FT_Open( device_num, &pmctl->
st.ftdi.port_handle );
2499 if ( status != FT_OK )
2506 switch ( baud_rate )
2508 case 300: ft_baud = FT_BAUD_300;
break;
2509 case 600: ft_baud = FT_BAUD_600;
break;
2510 case 1200: ft_baud = FT_BAUD_1200;
break;
2511 case 2400: ft_baud = FT_BAUD_2400;
break;
2512 case 4800: ft_baud = FT_BAUD_4800;
break;
2513 case 9600: ft_baud = FT_BAUD_9600;
break;
2514 case 14400: ft_baud = FT_BAUD_14400;
break;
2515 case 19200: ft_baud = FT_BAUD_19200;
break;
2516 case 38400: ft_baud = FT_BAUD_38400;
break;
2517 case 57600: ft_baud = FT_BAUD_57600;
break;
2518 case 115200: ft_baud = FT_BAUD_115200;
break;
2519 case 230400: ft_baud = FT_BAUD_230400;
break;
2520 case 460800: ft_baud = FT_BAUD_460800;
break;
2521 case 921600: ft_baud = FT_BAUD_921600;
break;
2529 for ( cp = framing; *cp; cp++ )
2531 char c = toupper( *cp );
2535 case '7': ft_data_bits = FT_BITS_7;
break;
2536 case '8': ft_data_bits = FT_BITS_8;
break;
2538 case 'N': ft_parity = FT_PARITY_NONE;
break;
2539 case 'E': ft_parity = FT_PARITY_EVEN;
break;
2540 case 'O': ft_parity = FT_PARITY_ODD;
break;
2543 case '1': ft_stopbits = FT_STOP_BITS_1;
break;
2544 case '2': ft_stopbits = FT_STOP_BITS_2;
break;
2552 status = FT_SetBaudRate( pmctl->
st.ftdi.port_handle, ft_baud );
2554 if ( status != FT_OK )
2557 status = FT_SetDataCharacteristics( pmctl->
st.ftdi.port_handle,
2558 ft_data_bits, ft_stopbits, ft_parity );
2560 if ( status != FT_OK )
2592 int rc = alloc_msg_ctl( &pmctl );
2595 return dev_open_finish( rc, pmctl, ppmctl );
2597 rc = mbgusbio_open( &pmctl->
st.usbio, mdev_info );
2600 return dev_open_fail_free( rc, &pmctl, ppmctl );
2626 return mbgusbio_reset( mdev_info );
2652 int rc = alloc_msg_ctl( &pmctl );
2655 return dev_open_finish( rc, pmctl, ppmctl );
2657 rc = mbgusbio_open_specific_device( &pmctl->
st.usbio, ldev );
2660 return dev_open_fail_free( rc, &pmctl, ppmctl );
2708 #endif // _USE_SERIAL_IO 2710 #if _USE_SERIAL_IO_FTDI 2713 FT_STATUS status = FT_Close( pmctl->
st.ftdi.port_handle );
2714 pmctl->
st.ftdi.port_handle = NULL;
2717 #endif // _USE_SERIAL_IO_FTDI 2721 rc = socket_close( pmctl );
2723 #endif // _USE_SOCKET_IO 2727 rc = mbgusbio_close( &pmctl->
st.usbio );
2729 #endif // _USE_USB_IO 2740 dealloc_msg_ctl( ppmctl );
2751 int do_force_conn_serial(
const char *dev,
int high_speed )
2756 #if DEBUG_FORCE_CONN 2757 const char *info = high_speed ?
" (hs)" :
"";
2759 int len = (int) strlen( cmd_str );
2777 #if DEBUG_FORCE_CONN 2778 fprintf( stderr,
"force conn%s probing failed to open port %s: %s: aborting\n",
2786 #if DEBUG_FORCE_CONN 2787 fprintf( stderr,
"force conn%s failed for port %s with %li/%s: %s: aborting\n",
2788 info, dev, (
long) baud_rate, framing,
mbg_strerror( rc ) );
2793 #if DEBUG_FORCE_CONN 2794 fprintf( stderr,
"force conn%s failed for port %s with %li/%s: %s: skipping\n",
2795 info, dev, (
long) baud_rate, framing,
mbg_strerror( rc ) );
2803 #ifdef MBG_TGT_WIN32 2809 Sleep( ( ( 10 * 1000 * len ) / baud_rate ) + 1 );
2824 rc = expected_baudrate;
2868 long rc = do_force_conn_serial( dev, 1 );
2878 rc = do_force_conn_serial( dev, 0 );
2885 #endif // _USE_SERIAL_IO 2889 #if _USE_SERIAL_IO_FTDI 2892 int do_force_conn_serial_ftdi(
int device_num,
const char *cmd_str,
BAUD_RATE expected_baudrate )
2906 DWORD bytes_written;
2915 port_handle = pmctl->
st.ftdi.port_handle;
2919 #if 0 //### TODO we need some error checking here 2920 if ( status != FT_OK )
2926 if ( bytes_written !=
sizeof( len ) )
2927 goto out_write_failed;
2930 #ifdef MBG_TGT_WIN32 2933 status = FT_Purge( port_handle, FT_PURGE_TX );
2941 Sleep( ( ( 10 * 1000 * len ) / baud_rate ) + 1 );
3009 #endif // _USE_SERIAL_IO_FTDI 3130 if ( pmctl == NULL )
3153 if ( pmctl == NULL )
3176 if ( pmctl == NULL )
3179 return sizeof( *pmctl->
rcv.
pmb );
3199 if ( pmctl == NULL )
3222 if ( pmctl == NULL )
3225 return sizeof( *pmctl->
xmt.
pmb );
3246 return xtiocomm_set_dev_poll_timeout( pmctl, new_timeout );
3266 return xtiocomm_get_dev_poll_timeout( pmctl );
3285 xtiocomm_set_msg_rcv_timeout( pmctl, new_timeout );
3305 return xtiocomm_get_msg_rcv_timeout( pmctl );
4013 ( pmctl->
st.sockio.use_ssh > 0 ) )
4615 GPS_CMD cmd,
void *buf,
size_t buf_size )
4620 ssize_t n_bytes = 0;
4623 #if _DEBUG_MSG_TIMING 4624 MBG_MSG_TIMES *pmt = &pmctl->mt;
4627 MBG_MSG_TIMES *pmt = &mt;
4631 mbg_tmo_get_time( &pmt->t_start );
4632 pmt->t_tmo = pmt->t_start;
4639 mbg_tmo_get_time( &pmt->t_now );
4641 if ( mbg_tmo_time_is_after( &pmt->t_now, &pmt->t_tmo ) )
4652 n_bytes = pmctl->
st.sockio.read( pmctl, buff,
sizeof( buff ) );
4671 #endif // _USE_SOCKET_IO 4691 #endif // _USE_SERIAL_IO 4693 #if _USE_SERIAL_IO_FTDI 4700 status = FT_Read( pmctl->
st.ftdi.port_handle, &buff[0],
4701 sizeof( buff[0] ), &bytes_read );
4703 if ( status != FT_OK )
4709 n_bytes = bytes_read;
4712 #endif // _USE_SERIAL_IO_FTDI 4717 rc = mbgusbio_read( &pmctl->
st.usbio, (
uint8_t *) buff,
sizeof( buff ) );
4731 #endif // _USE_USB_IO 4733 #if _USE_USB_DIRECT_IO 4738 pfd.fd = pmctl->
st.usbdio.usbdiofd;
4739 pfd.events = POLLIN | POLLRDNORM | POLLRDBAND;
4742 rc = poll( &pfd, 1, pmctl->
st.usbdio.poll_timeout );
4756 if ( pfd.revents & POLLHUP )
4763 if ( pfd.revents & ( POLLERR | POLLNVAL ) )
4770 if ( pfd.revents & ( POLLIN | POLLRDNORM | POLLRDBAND ) )
4772 rc = read( pmctl->
st.usbdio.usbdiofd, (
void*)buff,
sizeof(buff) );
4792 prctl = &pmctl->
rcv;
4795 for ( i = 0; i < n_bytes; i++ )
4842 if ( rcvd_cmd == cmd )
4870 if ( rcvd_cmd == cmd )
4932 if ( buf_size != pmb->
hdr.
len )
4934 #if defined( DEBUG ) 4937 fprintf( stderr,
"received data size (%u) doesn't match buffer size (%llu) for cmd: %s\n",
4938 pmb->
hdr.
len, (
unsigned long long) buf_size, cp ? cp :
"(unknown)" );
4945 memcpy( buf, &pmb->
u.
msg_data, buf_size );
4982 GPS_CMD cmd,
void *buf,
size_t buf_size )
5064 if ( n_bytes >
sizeof( pmb->
u.
msg_data ) )
5091 memcpy( pmb->
u.
bytes, p, n_bytes );
5145 rc =
xmt_cmd( pmctl, p_addr, cmd );
5281 GPS_CMD cmd,
void *buf,
size_t buf_size )
5289 rc =
xmt_cmd( pmctl, p_addr, cmd );
5580 uint16_t idx = ((port_idx << 8) | port_type_idx);
5685 printf(
"get rcvr info %i: %i\n", ++cnt, rc );
5731 rc = check_setup_legacy_usb_device(&pmctl->
st.usbio.mdev_info, p_ri );
5741 #endif // _USE_USB_IO 5773 IDENT ident = { { 0 } };
5795 xmt_cmd( pmctl, p_addr, 0x400 );
5796 xmt_cmd( pmctl, p_addr, 0x20F );
5797 xmt_cmd( pmctl, p_addr, 0x001 );
5810 #if _TRY_IDENT_DECODE 6054 for ( i = 0; i <
N_LLA; i++ )
6094 for ( i = 0; i <
N_LLA; i++ )
6130 for ( i = 0; i <
N_XYZ; i++ )
7420 #if 0 //##++ TODO: check if received idx matches requested idx 7423 printf(
"** Info for port %i requested, but for %i received.\n",
7461 for ( i = 0; i < n_str_type; i++ )
7505 #if 0 //##++ TODO: check if received idx matches requested idx 7508 printf(
"** Info for port %i requested, but for %i received.\n",
7548 for ( i = 0; i < n_com_ports; i++ )
7633 #if 0 //##++ TODO: check if received idx matches requested idx 7636 printf(
"** Info for port %i requested, but for %i received.\n",
7676 memset( pii, 0, n_prg_out *
sizeof( *pii ) );
7678 for ( i = 0; i < n_prg_out; i++ )
8496 #if 0 //##++ TODO: check if received idx matches requested idx 8499 printf(
"** Info for port %i requested, but for %i received.\n",
8535 for ( i = 0; i < n_supp; i++ )
8573 #if 0 //##++ TODO: check if received idx matches requested idx 8576 printf(
"** Info for port %i requested, but for %i received.\n",
8612 for ( i = 0; i < n_supp; i++ )
8851 if ( p->
idx == idx )
8854 #if defined( DEBUG ) 8855 fprintf( stderr,
"GPS_XMR_STATUS_IDX received reply idx %u, expected %u\n", idx, p->
idx );
9262 for ( i = 0; i < ptp_uc_master_cfg_limits->
n_supp_master; i++ )
10695 uint32_t idx = ((eidx << 16) | vidx);
11051 idx = ( ( fw_idx << 8 ) | ufu_idx );
11246 const void *payload,
11247 uint32_t payload_len)
11253 if ( ( !payload && payload_len ) || ( payload && !payload_len ))
11256 if ( payload_len >
sizeof( p_data->
payload ) )
11271 if ( payload && payload_len )
11273 memcpy( p_data->
payload, payload, payload_len );
11274 p_data->
length = payload_len;
11283 return mbgextio_xmt_msg( pmctl, p_addr, gps_cmd, NULL,
sizeof( *p_data ) );
12818 printf(
"Node info %li:", idx );
12820 printf(
" addr %02X:", p_addr->
hop_count );
12823 printf(
"%02X ", p_addr->
addr[i] );
12825 printf(
", state: %i", p_ni->
state );
12827 printf(
", name: \"%s\"", p_ri->
model_name );
12842 static int recursion_count;
12863 for ( i = 0; i < node_limits.
node_count; i++ )
12874 printf(
"** Warning: received XBP index %li for idx %li in %s\n",
12882 if ( recursion_count > 0 )
13114 #if _USE_TIME_MON && defined( _PRELIMINARY_CODE ) 13123 _mbg_swab_time_mon_inst_info( p );
13143 _mbg_swab_time_mon_inst_info( p_data );
13163 _mbg_swab_time_mon_target_settings( p_data );
13178 _mbg_swab_time_mon_target_status_idx( p );
13193 _mbg_swab_time_mon_target_ext_data_set_idx( p );
13199 #endif // _USE_TIME_MON && defined( _PRELIMINARY_CODE ) 13950 uint32_t scope_mask )
14151 uint32_t
u32 = ( ( idx << 16 ) | ctl );
PTP_UC_MASTER_SETTINGS_IDX ptp_uc_master_settings_idx
MBG_IO_PORT_INFO_IDX iop_info_idx
Binary reception in progress, i.e. after START_OF_HEADER received.
int mbgextio_get_net_intf_route_info_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_NET_INTF_ROUTE_INFO_IDX *p, uint16_t idx)
Read MBG_NET_INTF_ROUTE_INFO_IDX from the config with the given index.
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_io_ports
from device: acknowledge a command
XDEVFEAT_CHK_SUPP_FNC xdevfeat_supp_tlv_ptpv2_license
Check if a device supports PTPv2 license infos.
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_prog_pulses
MBG_PTP_V2_PORT_DATASET port_dataset
see MBG_PTP_V2_PORT_DATASET
A structure to used to read the status of the PTP protocol stack.
MBG_IP_ADDR addr
network address
int mbgextio_free_lan_devices(MBG_LAN_DEV_LIST *list)
Frees the MBG_LAN_DEV_LIST allocated by mbgextio_find_lan_devices.
int mbgextio_get_ntp_refclk_state_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, NTP_REFCLK_STATE_IDX *p, uint16_t idx)
Read the NTP refclock state of current idx in NTP_REFCLK_STATE format.
uint16_t TR_DISTANCE
Receiver distance from transmitter [km].
Query MBG_NET_INTF_ROUTE_SETTINGS by its index.
int mbgextio_get_net_stat_dns_srvr_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_IP_ADDR_IDX *p, uint16_t idx)
Read the current network DNS server in MBG_IP_ADDR_IDX format.
PTP_CFG_SETTINGS ptp_cfg_settings
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_service
NTP_PEER_SETTINGS_IDX ntp_peer_settings_idx
Configuration settings for a specific PTP unicast master.
#define MBGEXTIO_MSG_TIMEOUT_SERIAL
#define _mbg_swab_xbp_node_info_idx(_p)
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_fw_mngmnt
Check if a device supports the FW management API.
#define _mbg_swab_mbg_ims_fdm_output_settings_idx(_p)
int mbgextio_open_usb(const MBG_USB_DEV_INFO *mdev_info, MBG_MSG_CTL **ppmctl)
Open a binary communication channel using direct USB I/O.
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_supp_tlv_diag_file
Check if a device supports creating / sending a diagnostics file via TLV.
(r–) MBG_IMS_FDM_OUTPUT_INFO, only if MBG_IMS_STATE_FLAG_MSK_HAS_FDM is set in MBG_IMS_STATE::flags ...
Number of event log entries that can be stored and yet have been saved.
(r–) MBG_LNE_LIMITS, LNE API capabilities, only if MBG_XFEATURE_LNE_API
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_is_bus_lvl_dev
Check if a device is a bus level device.
(r–) XMULTI_REF_INFO_IDX, idx 0..XMULTI_REF_INSTANCES::n_xmr_settings-1, only if GPS_HAS_XMULTI_REF ...
int32_t BAUD_RATE
A data type to configure a serial port's baud rate.
(-w-) Transmit index of MBG_FW_INFO_IDX to be deleted
#define _mbg_swab_havequick_settings(_p)
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_is_tcr
Check if a device is a time code receiver(TCR)
Summary of configuration and health data of all satellites.
NTP trusted key settings.
int mbgextio_cmd_save_cfg(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr)
Send a command to let the device save it's current configuration as default.
Configuration settings of a specific serial port.
uint8_t n_str_type
max num of string types supported by any port
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_pos_lla
Check if a device supports reading the position as LLA array.
#define _mbg_swab_event_status_idx(_p, _type)
int mbgextio_set_net_intf_route_settings_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const MBG_NET_INTF_ROUTE_SETTINGS *p, uint16_t idx)
Send the network addr configuration in MBG_NET_INTF_ROUTE_SETTINGS format.
(rw-) ENABLE_FLAGS, when to enable serial, pulses, and synth, only if GPS_MODEL_HAS_ENABLE_FLAGS ...
int mbgextio_get_event_status_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, uint8_t vtype, MBG_EVENT_STATUS_IDX *p, uint16_t idx)
Read monitoring event status in MBG_EVENT_STATUS_IDX format.
uint16_t len
length of the data portion appended after the header
NTP trusted key info, with index.
(-w-) MBG_IO_PORT_SETTINGS_IDX, only supp. if MBG_XFEATURE_IO_PORTS is set in extended features ...
#define USB_DEV_CPC_01
USB device ID numbers assigned by Meinberg.
int mbgextio_req_data(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, GPS_CMD cmd, void *buf, size_t buf_size)
Transmit a message without a single ushort (16 bit) parameter.
#define _mbg_swab_mbg_lne_port_settings_idx(_p)
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_gps_stat_info
Check if a device supports the STAT_INFO structure and API.
#define _mbg_swab_gnss_sv_status_idx(_p)
MBG_MUTEX dev_mutex
Mutex to serialize device access.
int mbgextio_set_ignore_lock(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const IGNORE_LOCK *p)
Send the ignore lock configuration.
Output settings for FDM devices plus index.
#define _mbg_swab_syslog_info_idx(_p)
(r–) NTP_PEER_STATE_IDX, with index 0 ... NTP_CLNT_MODE_SETTINGS::num_peers - 1
int mbgextio_xmt_secu_settings(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const char *old_passwd, const char *new_passwd)
Send security settings for the socket connection.
int mbgserio_read_wait(MBGSERIO_DEV *mdev, void *buffer, uint count)
int mbgextio_get_xmr_holdover_status(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, XMR_HOLDOVER_STATUS *p)
Read XMR_HOLDOVER_STATUS.
int mbgextio_set_ptp_v2_current_dataset(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const MBG_PTP_V2_CURRENT_DATASET *p)
Send PTPv2 current dataset to a device in MBG_PTP_V2_CURRENT_DATASET format.
#define GPS_MODEL_NAME_FCU_01
(rw-) CFGH, SVs' configuration and health codes
(rw-) ANT_CABLE_LEN, length of antenna cable, only if GPS_MODEL_HAS_ANT_CABLE_LEN ...
int mbgextio_get_gnss_sat_info_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, GNSS_SAT_INFO_IDX *p, uint16_t idx)
::TODO
MBG_NET_INTF_ROUTE_SETTINGS settings
see MBG_NET_INTF_ROUTE_SETTINGS
An IPv4 or IPv6 network address.
(-w-) no data, only if RECEIVER_INFO::n_ucaps > 0
int mbgextio_get_xbp_limits(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, XBP_LIMITS *p)
Read the XBP_LIMITS to check which XBP features are supported.
int mbgextio_set_net_dns_srvr_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const MBG_IP_ADDR *p, uint16_t idx)
Send the network DNS server address in MBG_IP_ADDR format.
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_evt_log
(r–) MBG_DATABASE_GLB_INFO, only supp. if MBG_XFEATURE_DATABASE is set
(rw-) NTP_SRV_MODE_INFO/NTP_SRV_MODE_SETTINGS, only if NTP_MSK_ROLE_SERVER
int mbgextio_get_syslog_glb_info(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_SYSLOG_GLB_INFO *p)
Read the syslog global info in MBG_SYSLOG_GLB_INFO format.
connection via direct USB I/O operation
uint32_t idx
the index of the user
int mbgextio_get_xmr_ext_src_info_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, XMR_EXT_SRC_INFO_IDX *p, uint16_t idx)
Read XMR_EXT_SRC_INFO_IDX.
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_irig_tx
(rw-) IRIG_SETTINGS, only if GPS_HAS_IRIG_RX
int mbgextio_get_ext_sys_info(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_EXT_SYS_INFO *p)
int mbgextio_get_ptp_v2_parent_dataset(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_PTP_V2_PARENT_DATASET *p)
Read the PTPv2 parent dataset in MBG_PTP_V2_PARENT_DATASET format.
(rw-) MBG_REF_OFFS, only if GPS_HAS_REF_OFFS
(r–) MBG_NET_INTF_ADDR_INFO_IDX, addr status, only if MBG_NET_GLB_SUPP_STAGE_2_MASK is set in MBG_NE...
#define GPS_WILDCARD
A wildcard command code.
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_ptp
Check if a device supports the PTP API.
int mbgextio_get_all_ptp_uc_master_info(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, PTP_UC_MASTER_INFO_IDX *ptp_uc_master_info_idx, const PTP_UC_MASTER_CFG_LIMITS *ptp_uc_master_cfg_limits)
Read the ptp configuration ALL_PTP_UC_MASTER_INFO_IDX format.
#define _mbg_swab_mbg_pwr_ctl(_p)
MBG_NET_INTF_ROUTE_SETTINGS_IDX net_intf_route_settings_idx
#define MBG_FORCE_CONN_CMD_STR
Strings used to force connection settings for the binary protocol.
(r–) MBG_EVENT_STATUS_IDX, only supp. if MBG_XFEATURE_MONITORING is set in extended features ...
Global settings for user captures via network.
int mbgextio_get_net_stat_intf_link_info_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_NET_INTF_LINK_INFO_IDX *p, uint16_t idx)
Read MBG_NET_INTF_LINK_INFO_IDX from the status with the given index.
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_clk_res_info
Check if a device supports the MBG_CLK_RES_INFO structure.
connection via serial port
int mbgextio_get_ptp_v1_time_properties_dataset(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_PTP_V1_TIME_PROPERTIES_DATASET *p)
Read the PTPv1 time properties dataset in MBG_PTP_V1_TIME_PROPERTIES_DATASET format.
Settings of an IPv4-only network interface.
char * strncpy_safe(char *dst, const char *src, size_t max_len)
A portable, safe implementation of strncpy()
uint32_t node_count
Number of XBP nodes available in the system.
GPS UTC correction parameters.
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_ant_cable_length
Check if a device supports the ANT_CABLE_LEN structure and API.
#define _mbg_swab_snmp_v12_trap_info_idx(_p)
(rw-) PTP_CFG_INFO/PTP_CFG_SETTINGS, only if GPS_HAS_PTP
(r–) MBG_SERVICE_STATUS_IDX, index 0 .. MBG_SERVICE_MGMT_INFO::num_services - 1, only supp...
int mbgextio_get_ignore_lock(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, IGNORE_LOCK *p)
Read the status of ignore lock.
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_pos_xyz
Check if a device supports reading the position as XYZ array.
uint16_t n_supp_master
number of unicast masters which can be specified
#define MBG_ERR_DATA_SIZE
the received data size toesn't match the expected data size
(rw-) MBG_UCAP_NET_GLB_INFO/MBG_UCAP_NET_GLB_SETTINGS, only supp. if MBG_XFEATURE_UCAP_NET is set in ...
XDEVFEAT_CHK_SUPP_FNC xdevfeat_supp_tlv_ptpv1_license
Check if a device supports PTPv1 License Infos via TLV.
int mbgextio_get_ip4_state(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, IP4_SETTINGS *p)
Read the current lan ipv4 state IP4_SETTINGS format.
(r–) MBG_IMS_FDM_OUTPUT_STATE_IDX, only if MBG_IMS_STATE_FLAG_MSK_HAS_FDM is set in MBG_IMS_STATE::f...
A structure used to configure a PTP port.
(r–) IRIG_INFO, only if GPS_HAS_IRIG_RX
int mbgextio_get_ptp_uc_master_cfg_limits(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, PTP_UC_MASTER_CFG_LIMITS *p)
Read the ptp configuration PTP_UC_MASTER_CFG_LIMITS format.
int MBGEXTIO_CHK_SUPP_FNC(const MBG_MSG_CTL *pmctl)
Type of functions to check if a feature is supported.
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_ucap
int xmt_cmd(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, GPS_CMD cmd)
Send a binary command message without parameters.
ulong mbgextio_get_msg_rcv_timeout(const MBG_MSG_CTL *pmctl)
Get message receive timeout value.
(rw-) PTP_UC_MASTER_INFO_IDX/PTP_UC_MASTER_SETTINGS_IDX, only if PTP_CFG_CAN_BE_UNICAST_SLAVE ...
int mbgextio_get_led_settings_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_LED_SETTINGS_IDX *p, uint16_t idx)
Read a MBG_LED_SETTINGS_IDX parameter structure from a device.
int mbgextio_get_snmp_v12_trap_info_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_SNMP_V12_TRAP_INFO_IDX *p, uint16_t idx)
Read SNMP v1 or v2 trap info in MBG_SNMP_V12_TRAP_INFO_IDX format.
int mbgextio_get_ims_state(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_IMS_STATE *p)
Read the current IMS state and supported IMS features.
Structure that contains an index value and the NTP peer state.
POUT_SETTINGS pout_settings
(r–) STR_TYPE_INFO_IDX, names and capabilities of supp. string types, only if RECEIVER_INFO::n_str_t...
MBG_IO_PORT_SETTINGS_IDX iop_settings_idx
A The structure used to store the configuration of two serial ports.
int mbgextio_get_ptp_state(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, PTP_STATE *p)
Read the current state of PTP device PTP_STATE format.
#define _mbg_swab_nano_time_64(_p)
int xmt_cmd_us(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, GPS_CMD cmd, uint16_t us)
Send a binary command message with ushort (16 bit) parameter.
(r–) MBG_IP_ADDR_IDX, DNS status, only if MBG_NET_GLB_CFG_INFO::n_supp_dns_srvr > 0 ...
(r–) MBG_LED_INFO_IDX, settings and capabilities of an LED, only if MBG_XFEATURE_LED_API ...
MSG_CTL_DEVICE_FLAGS
Binary message control device flags.
#define _mbg_swab_net_glb_cfg_info(_p)
(rw-) MBG_NET_NAME_IDX, DNS cfg., only if MBG_NET_GLB_CFG_INFO::n_supp_dns_srch_dom > 0 ...
MBG_PTP_V1_PORT_DATASET_IDX ptp_v1_port_dataset_idx
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_database
Check if a device supports database(s) feature.
#define _mbg_swab_ext_sys_info(_p)
MBG_USER_PERM_BUF cfg_write_perm
current config write permissions, see MBG_USER_PERM_BUF and MBG_USER_PERMS
#define MBG_INVALID_SOCK_FD
A value to mark an MBG_SOCK_FD as invalid.
static int msg_return_code(MBG_MSG_CTL *pmctl)
Time scale configuration settings plus capabilities.
#define _mbg_swab_mbg_led_limits(_p)
#define _mbg_swab_io_port_limits(_p)
int mbgextio_get_opt_info(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_OPT_INFO *p)
Read current optional settings and supported options.
(rw-) TZCODE, time zone code, only if GPS_MODEL_IS_DCF_PZF
void mbgextio_register_async_data_callback(MBG_MSG_CTL *pmctl, MBG_ASYNC_DATA_HANDLER_FNC *fnc)
Register an asynchronous data handler callback function.
#define _mbg_swab_xmr_stats_idx(_p)
(r–) MBG_IMS_FDM_LIMITS, only if MBG_IMS_STATE_FLAG_MSK_HAS_FDM is set in MBG_IMS_STATE::flags ...
int mbgextio_get_net_dns_srvr_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_IP_ADDR_IDX *p, uint16_t idx)
Read a network DNS server entry in MBG_IP_ADDR_IDX format.
IP4_SETTINGS ip4_settings
void set_encryption_mode(MBG_MSG_CTL *pmctl, int mode, const char *key)
Set communication channel to specified encryption mode.
IRIG_SETTINGS irig_tx_settings
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_user_auth
Check if a device supports user authentication.
(rw-) NTP_PEER_SETTINGS_IDX, only if ??? //### TODO
Global network configuration settings.
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_enable_flags
Check if a device supports the ENABLE_FLAGS structure and API.
int mbgextio_get_port_info_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, PORT_INFO_IDX *p, uint16_t idx)
Read current settings and capabilities of a specific serial port.
MBG_UCAP_NET_RECV_SETTINGS_IDX ucap_net_recv_settings_idx
NTP refclock settings index.
(rw-) MBG_EVENT_INFO_IDX / MBG_EVENT_SETTINGS_IDX, only supp. if MBG_XFEATURE_MONITORING is set in ex...
int mbgextio_get_corr_info(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, CORR_INFO *p)
int mbgextio_get_ntp_glb_info(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, NTP_GLB_INFO *p)
Read the ntp global information NTP_GLB_INFO format.
long mbgextio_force_conn_serial(const char *dev)
Try to force a serial connection to a device.
#define _mbg_swab_mbg_ims_state(_p)
int mbgextio_socket_write_ssh(MBG_MSG_CTL *pmctl, const void *buf, size_t len)
Function, which can be used to write data to an SSH binary protocol channel.
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_monitoring
Check if a device supports the extended feature monitoring.
size_t mbgextio_get_rcv_buffer_size(MBG_MSG_CTL *pmctl)
Retrieve size of the allocated receive buffer.
(-w-) no data, save current config as default, only if MBG_XFEATURE_SAVE_CFG
int mbgextio_get_xmr_status_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, XMULTI_REF_STATUS_IDX *p, uint16_t idx)
Read XMULTI_REF_STATUS_IDX for a specific XMR source.
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_user_mngmnt
Check if a device supports user management.
NTP_SRV_MODE_SETTINGS ntp_srv_mode_settings
NTP orphan mode settings to be read from / written to a device.
int mbgextio_get_ntp_symm_key_info_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, NTP_SYMM_KEY_INFO_IDX *p, uint16_t idx)
Read the NTP symmetric key info with the given index in NTP_SYMM_KEY_INFO_IDX format.
#define _mbg_swab_mbg_gpio_freq(_p)
MBG_SNMP_V3_SETTINGS_IDX snmp_v3_settings_idx
#define _mbg_swab_ptp_v2_current_dataset(_p)
(r–) MBG_XFEATURE_BUFFER, only if GPS_HAS_XFEATURE
Detailed GNSS satellite status, plus index.
int mbgextio_set_snmp_v12_settings_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const MBG_SNMP_V12_SETTINGS *p, uint16_t idx)
Write SNMP v1 or v2 settings in MBG_SNMP_V12_SETTINGS format.
#define MBG_DEFAULT_FRAMING
Definitions used with the Meinberg binary protocol.
MBG_PTP_V2_DEFAULT_DATASET ptp_v2_default_dataset
IRIG_SETTINGS irig_rx_settings
(rw-) MBG_PTP_V2_PARENT_DATASET, only supp. if PTP_CFG_MSK_HAS_V2_COMMON_DATASETS is set in PTP_CFG_I...
#define _mbg_swab_user_mngmnt_info(_p)
MBG_IP_ADDR_IDX ip_addr_idx
(r–) MBG_IO_PORT_STATUS_IDX, only supp. if MBG_XFEATURE_IO_PORTS is set in extended features and fro...
XDEVFEAT_CHK_SUPP_FNC xdevfeat_is_gps
Check if a device can receive the GPS satellite system.
PTP_UC_MASTER_INFO_IDX ptp_uc_master_info_idx
#define MBG_ERR_UNKNOWN
Unknown error code from external API.
(w–) MBG_SERVICE_CTL, index 0 .. MBG_SERVICE_MGMT_INFO::num_services - 1, only supp. if MBG_XFEATURE_SERVICE
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_bvar_stat
PTPv1 current dataset containing information about the synchronization status of the device...
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_supp_tlv_exec_cmd
Check if a device supports command execution via TLV.
A timestamp with nanosecond resolution, but 64 bit size.
#define _mbg_swab_svc_status_idx(_p)
#define _mbg_swab_io_port_status_idx(_p)
uint16_t idx
port index, 0..RECEIVER_INFO::n_com_ports-1
(-w-) MBG_TIME_MON_TARGET_SETTINGS
connection via direct USB
#define _mbg_swab_ntp_srv_mode_info(_p)
(rw-) MBG_PTP_V1_PARENT_DATASET, only supp. if PTP_CFG_MSK_HAS_V1_COMMON_DATASETS is set in PTP_CFG_I...
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_irig_rx
#define _mbg_swab_snmp_v12_info_idx(_p)
int mbgextio_register_push_msg(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, GPS_CMD cmd)
Register for command specific push messages.
int MBG_TIME_MON_TARGET_EXT_DATA_SET_IDX
(r–) MBG_EXT_SYS_INFO, extended revision information, only if MBG_XFEATURE_EXT_SYS_INFO ...
int mbgextio_set_ims_fdm_settings(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const MBG_IMS_FDM_SETTINGS *p)
Write a MBG_IMS_FDM_SETTINGS parameter structure to a device.
char name[(16+1)]
Optional string identifying a customized firmware version, should be empty in standard versions...
#define MBG_ERR_CONN_TYPE
Binary protocol no valid/supported connection type specified.
#define _mbg_swab_database_cmd(_p)
Status information on a ref time source at a specific priority level.
#define MBG_ERR_INV_PARM
Invalid parameter.
int mbgextio_open_serial_ftdi(int device_num, MBG_MSG_CTL **ppmctl, uint32_t baud_rate, const char *framing)
Open a binary communication channel using serial FTDI D2xx port.
int mbgextio_get_user_status_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_USER_STATUS_IDX *p, uint16_t idx)
Read the user status with the given index in MBG_USER_STATUS_IDX format.
PTPv1 port dataset containing information about the appropriate port of the device.
int mbgextio_get_pos_lla(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, LLA lla)
Read the current receiver position as LLA array.
(rw-) MBG_TIME_SCALE_SETTINGS/MBG_TIME_SCALE_INFO, only if GPS_HAS_TIME_SCALE
int mbgextio_get_net_glb_cfg_info(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_NET_GLB_CFG_INFO *p)
Read the network global config information MBG_NET_GLB_CFG_INFO format.
int mbgextio_set_ant_cable_len(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const ANT_CABLE_LEN *p)
Send the GPS antenna cable length configuration.
int16_t channel
-1: the current on-board time; >= 0 the capture channel number
#define _mbg_swab_snmp_v3_settings_idx(_p)
#define _mbg_swab_mbg_opt_info(_p)
int _MBG_API MBG_ASYNC_MSG_HANDLER_FNC(MBG_MSG_CTL *pmctl)
Type of a callback function to handle spurious binary messages.
int mbgextio_get_xbp_node_limits(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, XBP_NODE_LIMITS *p)
Read the XBP_NODE_LIMITS to check how many ports are provided.
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_scu_stat
Check if the device supports the SCU_STAT structures.
int mbgextio_time_mon_send_inst_info(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const MBG_TIME_MON_INST_INFO *p)
#define _mbg_swab_mbg_gnss_mode_settings(_p)
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_irig_tx
int mbgextio_set_tzdl(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const TZDL *p)
Set the local time conversion parameters in TZDL format.
(r–) MBG_TLV_INFO, query information on which TLV stuff is supported, only if MBG_XFEATURE_TLV_API ...
NTP_TRUSTED_KEY_SETTINGS settings
(r–) deprecated, SW_REV, software revision, use only if GPS_RECEIVER_INFO not supp.
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_pos_lla
int mbgextio_set_fdm_tdev(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const NANO_TIME_64 *p)
Set time deviation of powerline time in relation to the current reference time.
int mbgextio_get_ims_fdm_info(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_IMS_FDM_INFO *p)
Read a MBG_IMS_FDM_INFO parameter structure from a device.
#define _mbg_swab_xmulti_ref_instances(_p)
#define _mbg_swab_gnss_sat_info_idx(_p)
int mbgextio_set_tr_distance(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const TR_DISTANCE *p)
Set the transmitter distance (km) in TR_DISTANCE format.
uint32_t ticks_per_sec
resolution of fractions of seconds, see GPS_TICKS_PER_SEC
static int dev_open_finish_setup(MBG_MSG_CTL **ppmctl, MBG_MSG_CTL **caller_ppmctl)
NTP symmetric key specific settings.
#define _mbg_swab_net_name(_p)
(r–) XMULTI_REF_STATUS_IDX, idx 0..XMULTI_REF_INSTANCES::n_xmr_settings-1, only if GPS_HAS_XMULTI_RE...
Current IRIG settings and supported codes.
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_net_cfg
Check if a device supports the new NET_CFG API.
#define _mbg_swab_net_glb_cfg_settings(_p)
Configuration settings of a serial port.
MBG_LED_SETTINGS_IDX led_settings_idx
NTP_REFCLK_CFG_SETTINGS settings
See NTP_REFCLK_CFG_SETTINGS.
(rw-) NTP_GLB_INFO/NTP_GLB_SETTINGS, only if GPS_HAS_NTP
(r–) next MBG_EVT_LOG_ENTRY, only if GPS_HAS_EVT_LOG
A structure used to configure optional settings.
int mbgextio_get_ims_fdm_state(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_IMS_FDM_STATE *p)
Read a MBG_IMS_FDM_STATE parameter structure from a device.
int mbgextio_set_ntp_refclk_cfg_settings_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const NTP_REFCLK_CFG_SETTINGS *p, uint16_t idx)
Send NTP refclk config settings with the given index in NTP_REFCLK_CFG_SETTINGS format.
#define _mbg_swab_user_status_idx(_p)
int mbgextio_open_socket(const char *host, MBG_MSG_CTL **ppmctl, const char *passwd)
Open a binary communication channel via a LAN/socket connection.
int mbgextio_get_xmr_info_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, XMULTI_REF_INFO_IDX *p, uint16_t idx)
Read XMULTI_REF_INFO_IDX for a specific XMR source.
int mbgextio_set_pwr_ctl(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const MBG_PWR_CTL *p)
Write a MBG_PWR_CTL parameter structure to a device.
#define _mbg_swab_mbg_ims_fdm_settings(_p)
int mbgserio_write(MBGSERIO_DEV *mdev, const void *buffer, unsigned int count)
#define GPS_MODEL_NAME_SCU_01
(r–) BVAR_STAT, status of buffered variables, only if GPS_MODEL_HAS_BVAR_STAT
see USER_SCOPE_STATUS_READ
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_pos_xyz
Information on available XBP nodes.
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_transactions
Check if a device has MBG_XFEATURE_TRANSACTIONS.
#define _mbg_swab_xmulti_ref_status_idx(_p)
static int chk_get_rcvr_info(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, RECEIVER_INFO *p)
NTP refclock info, with index.
The data checksum of a received message is invalid.
static __mbg_inline int num_bits_set(long val)
Count the number of bits which are not 0.
#define _mbg_swab_snmp_v12_settings_idx(_p)
uint8_t hop_count
Used as index to the addr array.
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_user_mngmnt
Check if a device supports user management.
NTP_TRUSTED_KEY_SETTINGS_IDX ntp_trusted_key_settings_idx
Peer settings for NTP devices to configure an upload NTP server.
(r–) PTP_UC_MASTER_CFG_LIMITS, only if PTP_CFG_CAN_BE_UNICAST_SLAVE
(rwa) encrypted binary packet
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_ims
#define _mbg_swab_net_intf_addr_settings_idx(_p)
int mbgextio_open_serial(const char *dev, MBG_MSG_CTL **ppmctl, uint32_t baud_rate, const char *framing)
Open a binary communication channel using direct serial I/O.
int mbgserio_open(MBGSERIO_DEV **pp_mdev, const char *dev_name)
Open a serial port and set up a MBGSERIO_DEV structure.
int mbgextio_get_holdover_interval_counter(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, XMR_HOLDOVER_INTV *p)
Read the XMR holdover interval counter.
MBG_MSG_BUFF * mbgextio_get_rcv_buffer_addr(MBG_MSG_CTL *pmctl)
Retrieve address of the allocated receive buffer.
(r–) MBG_LED_LIMITS, LED API capabilities, only if MBG_XFEATURE_LED_API
#define _mbg_swab_svc_settings_idx(_p)
uint16_t idx
0..MBG_UCAP_NET_GLB_SETTINGS::num_recvs-1
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_tainted_cfg
Check if a device supports the Tainted config Tainted Config API.
(r–) XBP_LIMITS, only if GPS_HAS_XBP
#define GPS_MODEL_NAME_GPS16X
int mbgextio_get_fw_glb_info(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_FW_GLB_INFO *p)
Read the firmware global information in MBG_FW_GLB_INFO format.
int mbgextio_get_irig_tx_info(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, IRIG_INFO *p)
Read configuration info and supported features of the device's IRIG output.
int mbgextio_get_tzcode(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, TZCODE *p)
Read the local time conversion configuration in TZCODE format.
XMR timing metrics for a particular source, with index.
(r–) XMR_STATS_IDX, only if XMR_EXT_SRC_FEAT_FLAG_MSK_STATS
static const char force_conn_hs_cmd_str[]
(r–) MBG_USER_INFO for the authenticated user, see MBG_XFEATURE_USER_AUTH
uint32_t idx
index, 0..PTP_UC_MASTER_CFG_LIMITS::n_supp_master-1
PTPv1 parent dataset containing information about the master (parent) of the device.
(rw-) MBG_SYSLOG_GLB_INFO / MBG_SYSLOG_GLB_SETTINGS, only supp. if MBG_MONITORING_TYPE_MSK_SYSLOG is ...
#define _check_user_perm(_user_perm_bit, _user_perm_buffp)
Check a user permission in a MBG_USER_PERM_BUF.
MBG_MSG_BUFF * pmb
points to unencrypted message buffer
XDEVFEAT_CHK_SUPP_FNC xdevfeat_is_bus_lvl_dev
Check if a device is a bus level device.
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_is_gnss
Check if a device supports the GNSS API.
#define _mbg_swab_ntp_symm_key_limits(_p)
int mbgextio_get_snmp_v3_info_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_SNMP_V3_INFO_IDX *p, uint16_t idx)
Read SNMP v3 info in MBG_SNMP_V3_INFO_IDX format.
Query MBG_NET_INTF_LINK_INFO by its index.
int mbgextio_set_ptp_v2_default_dataset(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const MBG_PTP_V2_DEFAULT_DATASET *p)
Send PTPv2 default dataset to a device in MBG_PTP_V2_DEFAULT_DATASET format.
legacy device with proprietary protocol, see mbgextio_dev_is_legacy
PORT_SETTINGS_IDX port_settings_idx
int mbgextio_get_all_gnss_sat_info(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, GNSS_SAT_INFO_IDX gsii[], const MBG_GNSS_MODE_INFO *p_mi)
::TODO Read an array of all supported string types
(r–) MBG_CLK_RES_INFO, only if MBG_XFEATURE_CLK_RES_INFO
Client settings of an NTP device.
(r–) PORT_INFO_IDX, serial port settings and capabilities, only if RECEIVER_INFO::n_com_ports > 0 ...
MBG_SYSLOG_SETTINGS_IDX syslog_settings_idx
Configuration settings for a HaveQuick input or output.
Current settings and general capabilities of a specific unicast master.
Query MBG_NET_INTF_ROUTE_INFO by its index.
int sn_cpy_str_safe(char *dst, size_t max_len, const char *src)
A function to copy a string safely, returning the number of characters copied.
(rw-) MBG_TIME_MON_INST_INFO
int mbgextio_get_lan_if_info(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, LAN_IF_INFO *p)
Read the lan interface configuration LAN_IF_INFO format.
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_supp_tlv_ntp_license
Check if a device supports supports NTP license infos via TLV.
Information on an XBP node with specific index.
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_pzf
Check if a device can receive DCF77 PZF.
#define MBG_ERR_GENERIC
Generic error.
int mbgextio_set_ptp_v1_port_dataset_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const MBG_PTP_V1_PORT_DATASET *p, uint16_t idx)
Send PTPv1 port dataset with the appropriate index to a device in MBG_PTP_V1_PORT_DATASET format...
int mbgextio_set_user_mngmnt_settings(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const MBG_USER_MNGMNT_SETTINGS *p)
Send the user configuration in MBG_USER_MNGMNT_SETTINGS format.
int mbgextio_get_ntp_refclk_cfg_info_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, NTP_REFCLK_CFG_INFO_IDX *p, uint16_t idx)
Read the NTP refclock config info with the given index in NTP_REFCLK_CFG_INFO_IDX format...
int mbgextio_get_fdm_freq(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_GPIO_FREQ *p)
Read a MBG_GPIO_FREQ parameter structure from a device.
int mbgextio_get_gnss_mode_info(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_GNSS_MODE_INFO *p)
Read current GNSS mode settings and supported features.
RI_FEATURES features
optional features, see GPS_FEATURE_MASKS
#define mbg_rc_is_success(_rc)
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_serouts
(r–) MBG_TIME_MON_TARGET_EXT_DATA_SET_IDX
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_user_auth
Check if a device supports user authentification.
int mbgextio_get_ntp_sys_state(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, NTP_SYS_STATE *p)
Read the current system state of ntp device NTP_SYS_STATE format.
uint32_t idx
port index, 0..MBG_GPIO_CFG_LIMITS::num_io-1
int mbgextio_rcv_msg_unlocked(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, GPS_CMD cmd, void *buf, size_t buf_size)
Generic reception of a binary message.
(rw-) MBG_LED_SETTINGS_IDX, settings of a specific LED, only if MBG_XFEATURE_LED_API ...
(r-a) TTM, user capture events, only if RECEIVER_INFO::n_ucaps > 0
uint16_t GPS_CMD
The type of a GPS command code.
(rw-) NTP_CLNT_MODE_INFO/NTP_CLNT_MODE_SETTINGS, only if NTP_MSK_ROLE_CLIENT
int mbgextio_get_syslog_info_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_SYSLOG_INFO_IDX *p, uint16_t idx)
Read syslog server information in MBG_SYSLOG_INFO_IDX format.
XDEVFEAT_CHK_SUPP_FNC xdevfeat_supp_tlv_fw_rollback
Check if a device supports a factory reset via TLV.
int mbgextio_set_user_level_settings_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const MBG_USER_SETTINGS *p, uint16_t idx)
Write user level settings in MBG_USER_SETTINGS_IDX format.
int mbgextio_get_fw_info_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_FW_INFO_IDX *p, uint16_t idx)
Read the firmware info with the given index in MBG_FW_INFO_IDX format.
#define MBG_ERR_DATA_CSUM
Binary protocol data checksum error.
int mbgextio_get_svc_status_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_SERVICE_STATUS_IDX *p, uint16_t idx)
Read the service status with the given index in MBG_SERVICE_STATUS_IDX format.
MBG_OPT_SETTINGS opt_settings
#define _mbg_swab_ntp_glb_info(_p)
#define _mbg_swab_ant_info(_p)
int mbgextio_get_xmr_ext_source_metrics_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, XMR_METRICS_IDX *p, uint16_t idx)
Read XMR_METRICS_IDX for a specific XMR source.
int mbgextio_set_opt_settings(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const MBG_OPT_SETTINGS *p)
Send new optional settings flags.
MBG_SNMP_V3_TRAP_SETTINGS_IDX snmp_v3_trap_settings_idx
#define _mbg_swab_ucap_net_glb_settings(_p)
#define _mbg_swab_mbg_clk_res_info(_p)
MBG_GPIO_SETTINGS_IDX gpio_settings_idx
MBG_XDEV_FEATURES xdev_features
Receiver info plus extended device features.
(r–) GNSS_SAT_INFO_IDX, only if MBG_GNSS_FLAG_MSK_SAT_INFO_IDX_SUPP_SER, deprecates GPS_GNSS_SAT_INF...
XDEVFEAT_CHK_SUPP_FNC xdevfeat_supp_tlv_ntp_license
Check if a device supports NTP license infos via TLV.
MBG_SNMP_V12_SETTINGS_IDX snmp_v12_settings_idx
(r–) MBG_LNE_PORT_INFO_IDX, settings and capabilities of an LED, only if MBG_XFEATURE_LNE_API ...
int mbgextio_socket_read_ssh(MBG_MSG_CTL *pmctl, void *buf, size_t len)
Function, which can be used to read data from an SSH binary protocol channel.
int mbgextio_unregister_push_msg(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, GPS_CMD cmd)
Unregister for command specific push messages.
MBG_SERVICE_SETTINGS_IDX svc_settings_idx
#define _mbg_swab_ntp_glb_settings(_p)
int mbgextio_get_database_glb_info(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_DATABASE_GLB_INFO *p)
Read global database information in MBG_DATABASE_GLB_INFO format.
uint8_t n_com_ports
number of on-board serial ports
int mbgextio_get_ptp_v1_current_dataset(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_PTP_V1_CURRENT_DATASET *p)
Read the PTPv1 current dataset in MBG_PTP_V1_CURRENT_DATASET format.
A generic structure used to specify FDM limits.
int mbgextio_set_ntp_srv_mode_cfg(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const NTP_SRV_MODE_SETTINGS *p)
Send the NTP server mode configuration.
#define _mbg_swab_corr_info(_p)
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_req_ttm
Check if a device has MBG_XFEATURE_REQ_TTM.
(rw-) MBG_GNSS_MODE_INFO/MBG_GNSS_MODE_SETTINGS, GNSS operation mode
#define _mbg_swab_ntp_symm_key_settings_idx(_p)
XBP_MSG_DATA xbp_msg_data
XBP address field plus encapsulated standard message.
Query MBG_NET_INTF_ADDR_SETTINGS by its index.
#define _mbg_swab_tzcode(_p)
(r–) MBG_IO_PORT_TYPE_INFO_IDX, only supp. if MBG_XFEATURE_IO_PORTS is set in extended features and ...
XMR statistics for a particular source, with index.
#define MBGEXTIO_READ_BUFFER_SIZE
#define _mbg_swab_mbg_time_scale_settings(_p)
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_net_cfg
Check if a device supports the new NET_CFG API.
#define _mbg_swab_snmp_glb_settings(_p)
int mbgextio_set_ptp_cfg_settings(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const PTP_CFG_SETTINGS *p)
Send configuration settings for PTP.
int mbgextio_set_pout_settings_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const POUT_SETTINGS *p, uint16_t idx)
Send configuration settings for a specific programmable pulse output.
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_serouts
(r–) MBG_MONITORING_LIMITS, only supp. if MBG_XFEATURE_MONITORING is set in extended features ...
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_pwr_ctl_api
Check if a device supports the power control API.
MBG_MSG_BUFF * pmb
points to unencrypted message buffer
#define _mbg_swab_ptp_v1_time_properties_dataset(_p)
int xdevfeat_has_time_ttm(const MBG_XDEV_FEATURES *p_xdf)
Check if the device supports the builtin feature TIME.
A generic structure used to hold a GPIO port's settings.
ulong msg_rcv_timeout
Binary message receive timeout [ms].
XBP_NODE_INFO node_info
RECEIVER_INFO of the device behind this node
MBG_IMS_FDM_OUTPUT_SETTINGS settings
int mbgextio_get_user_level_info_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_USER_INFO_IDX *p, uint16_t idx)
Read the user level info with the given index in MBG_USER_INFO_IDX format.
void mbgextio_register_async_msg_callback(MBG_MSG_CTL *pmctl, MBG_ASYNC_MSG_HANDLER_FNC *fnc)
Register an asynchronous message handler callback function.
#define MBG_ERR_NBLOCK_WAIT_SLCT
Select timed out when waiting for non-blocking network port to become ready.
#define _mbg_swab_io_port_settings_idx(_p, _recv)
int mbgextio_set_net_glb_cfg_settings(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const MBG_NET_GLB_CFG_SETTINGS *p)
Set the device's global network configuration settings.
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_lne_api
Check if a device supports the LNE API.
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_is_dcf
Check if a device is a DCF77 receiver.
#define GPS_MODEL_NAME_TSU_01
static int mbgextio_check_ack(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, GPS_CMD cmd)
Configuration settings for a single programmable pulse output.
int mbgextio_get_ref_offs(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_REF_OFFS *p)
Read current ref offset to UTC configuration.
Structure that represents the current system status of an NTP device.
#define _mbg_swab_bvar_stat(_p)
int mbgextio_get_tainted_cfg(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_TAINTED_CFG *p)
Read MBG_TAINTED_CFG structure from a device.
uint16_t BVAR_STAT
Status flags of battery buffered data.
MBG_NET_INTF_LINK_SETTINGS_IDX net_intf_link_settings_idx
MBG_NET_NAME_IDX net_name_idx
NTP_MISC_ORPHAN_MODE_SETTINGS ntp_misc_orphan_mode_settings
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_gpio
int mbgextio_set_ptp_v1_current_dataset(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const MBG_PTP_V1_CURRENT_DATASET *p)
Send PTPv1 current dataset to a device in MBG_PTP_V1_CURRENT_DATASET format.
PTPv2 time properties dataset.
XDEVFEAT_CHK_SUPP_FNC xdevfeat_supp_tlv_fw_update
Check if a device supports a firmware update via TLV.
(rw-) NTP_REFCLK_CFG_INFO_IDX, only if NTP_SRV_MODE_SETTINGS::num_refclks > 0
NANO_TIME_64 nano_time_64
Time scale configuration settings.
MBG_EVENT_SETTINGS_IDX event_settings_idx
#define _mbg_swab_mbg_evt_log_entry(_p)
int mbg_win32_wsa_err_to_mbg(int wsa_err, const char *info)
Translate a Windows socket API error code to one of the MBG_ERROR_CODES.
#define _mbg_swab_database_info_idx(_p)
int mbgextio_get_ntp_srv_mode_info(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, NTP_SRV_MODE_INFO *p)
Read the ntp server mode information in NTP_SRV_MODE_INFO format.
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_gps_stat_info
Check if a device supports the STAT_INFO structure and API.
NTP refclock specific settings.
int mbgextio_time_mon_send_target_settings(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const MBG_TIME_MON_TARGET_SETTINGS *p)
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_time_ttm
#define _mbg_swab_tainted_cfg(_p)
int mbgextio_xmt_msg(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, GPS_CMD cmd, const void *p, uint16_t n_bytes)
Set up and send a generic binary message.
(rw-) MBG_USER_INFO_IDX / MBG_USER_SETTINGS_IDX, index 0 .. MBG_USER_MNGMNT_SETTINGS::num_users, only supp. if MBG_XFEATURE_USER_MNGMNT
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_raw_irig_data
Check if a timecode receiver provides MBG_RAW_IRIG_DATA.
(rw-) MBG_IP_ADDR_IDX, DNS cfg., only if MBG_NET_GLB_CFG_INFO::n_supp_dns_srvr > 0 ...
int mbgextio_get_ntp_peer_settings_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, NTP_PEER_SETTINGS_IDX *p, uint16_t idx)
Read the ntp peer settings of current idx NTP_PEER_SETTINGS format.
SCU_STAT_SETTINGS scu_stat_settings
#define _mbg_swab_ptp_uc_master_info_idx(_p)
(-w-) no data, clear event log command, only if GPS_HAS_EVT_LOG
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_up_conv
Check if the device has an L1 frequency up converter.
#define _mbg_swab_xmr_ext_src_info_idx(_p)
MBG_USER_PERM_BUF stat_read_perm
current status read permissions, see MBG_USER_PERM_BUF and MBG_USER_PERMS
int MBG_SOCK_FD
A socket file descriptor type.
MBG_LNE_PORT_SETTINGS settings
LNE settings.
MBG_NET_INTF_ADDR_SETTINGS settings
see MBG_NET_INTF_ADDR_SETTINGS
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_raw_irig_data
Check if a timecode receiver provides MBG_RAW_IRIG_DATA.
Configuration settings for a single LNE port.
#define GPS_MODEL_NAME_CMC_01
(rw-) NTP_SYMM_KEY_INFO_IDX / NTP_SYMM_KEY_SETTINGS_IDX, only if NTP_MSK_SYMM_KEYS is set in NTP_SRV_...
(r-a) ANT_INFO, time diff after antenna disconnect, only if GPS_MODEL_HAS_ANT_INFO ...
int mbg_posix_errno_to_mbg(int posix_errno, const char *info)
Translate a POSIX errno error code to one of the MBG_ERROR_CODES.
int mbgextio_get_xbp_node_info_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, XBP_NODE_INFO_IDX *p, uint16_t idx)
Read the XBP_NODE_INFO for a specific node in XBP_NODE_INFO_IDX format.
XMULTI_REF_SETTINGS_IDX xmulti_ref_settings_idx
int mbgextio_get_all_port_info(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, PORT_INFO_IDX pii[])
Read an array of current settings and capabilities of all serial ports.
int mbgextio_set_irig_rx_settings(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const IRIG_SETTINGS *p)
Send new configuration settings for the device's IRIG input.
#define _mbg_swab_dummy(_x)
A placeholder for yet missing mbg_swab..() macros.
(r–) NTP_REFCLK_STATE_IDX, with index 0 ... NTP_SRV_MODE_SETTINGS::num_refclks - 1 ...
void init_transfer(MBG_MSG_RCV_CTL *prctl)
Init reception of a binary message.
int mbgextio_get_io_port_info_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_IO_PORT_INFO_IDX *p, uint8_t idx)
Read I/O port info in MBG_IO_PORT_INFO_IDX format.
NTP symm key info, with index.
int mbgextio_get_first_evt_log_entry(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_EVT_LOG_ENTRY *p)
Return the first entry from the on-board event log.
union MBG_MSG_CTL_s::st st
uint16_t model_code
identifier for receiver model, see GPS_MODEL_CODES
#define _mbg_swab_ntp_srv_mode_settings(_p)
char sernum[(16+1)]
ASCIIZ, serial number.
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_evt_log
Check if a device supports the event log API.
(rw-) req: uint16_t SV num, SV_ALM, one SV's almanac
int mbgextio_get_pwr_ctl(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_PWR_CTL *p)
Read a MBG_PWR_CTL parameter structure from a device.
#define _mbg_swab_scu_stat_info(_p)
Additional parameters for SMPTE ST 2059-2 profile.
(rw-) HAVEQUICK_SETTINGS for input, only if GPS_HAS_HAVEQUICK
int mbgextio_req_data_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, GPS_CMD cmd, uint16_t idx, void *buf, size_t buf_size)
Read a specific element of an array of data structures.
MBG_PTP_V2_PORT_DATASET_IDX ptp_v2_port_dataset_idx
MBG_SNMP_V12_SETTINGS settings
bool dev_has_receiver_info
uint32_t length
Payload data length of MBG_DATABASE_CMD::payload.
Information on a specific supported string format.
#define _mbg_swab_xmr_holdover_status(_p)
int _MBG_API MBG_ASYNC_DATA_RESET_FNC(MBG_MSG_CTL *pmctl)
Type of a callback function to reset handling of spurious asynchronous data bytes.
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_supp_tlv_ptpv1_license
Check if a device supports supports PTPv1 License Infos via TLV.
A structure used to specify a variable frequency.
(rw-) MBG_DATABASE_INFO_IDX / MBG_DATABASE_SETTINGS_IDX, index 0..MBG_DATABASE_GLB_INFO::num_dbs - 1...
(r–) RECEIVER_INFO, model specific info, not supported by very old devices
int _MBG_API MBG_NACK_HANDLER_FNC(MBG_MSG_CTL *pmctl)
Type of a callback function to optionally handle NACK messages.
int mbgextio_get_time(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, TTM *p)
Read the current time as TTM strucure.
Reference source configuration for a specific priority level.
#define _mbg_swab_event_info_idx(_p)
Settings, features and flags for receivers of user captures via network.
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_prog_pulses
Client settings info of an NTP device.
#define MBG_ERR_RCVD_NO_ACK
Binary protocol received reply msg without expected ACK code. //### TODO.
#define _mbg_swab_ntp_clnt_mode_info(_p)
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_reboot
Check if a device has MBG_XFEATURE_REBOOT.
#define _mbg_mutex_destroy(_pm)
int mbgextio_get_sv_alm(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, SV_ALM *p, SVNO svno)
Read the GPS almanach for the specified SV from a device.
HAVEQUICK_SETTINGS havequick_settings
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_supp_tlv_time_monitor_license
Check if a device supports supportsTime Monitor License infos via TLV.
size_t mbgextio_get_xmt_buffer_size(MBG_MSG_CTL *pmctl)
Retrieve size of the allocated transmit buffer.
connection via FTDI D2xx USB-To-Serial converter
(rwa) eXtended Binary Packet, only if GPS_HAS_XBP, see eXtended Binary Protocol definitions ...
#define mbg_rc_is_success_or_err_perm(_rc)
#define _mbg_swab_ptp_v1_current_dataset(_p)
int mbgextio_set_time_scale_settings(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const MBG_TIME_SCALE_SETTINGS *p)
Send new time scale configuration settings.
#define _mbg_swab_fw_ufu_info_idx(_p)
MBG_USER_SETTINGS_IDX user_settings_idx
int mbgextio_get_scu_stat_info(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, SCU_STAT_INFO *p)
Read SCU_STAT_INFO from the device.
#define _mbg_swab_database_settings_idx(_p)
int mbgextio_open_ssh_socket(const char *host, MBG_MSG_CTL **ppmctl, SSH_DATA *ssh_data)
#define _mbg_swab_pout_settings_idx_on_set(_p)
#define MBG_ERR_TIMEOUT
Timeout accessing the device.
(r–) XMULTI_REF_INSTANCES, only if GPS_HAS_XMRS_MULT_INSTC
(rw-) MBG_UCAP_NET_RECV_INFO_IDX/MBG_UCAP_NET_RECV_SETTINGS_IDX, only supp. if MBG_XFEATURE_UCAP_NET ...
#define GPS_MODEL_NAME_CPC180
int mbgextio_req_data_idx_unlocked(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, GPS_CMD cmd, uint16_t idx, void *buf, size_t buf_size)
Read a specific element of an array of data structures.
void mbgextio_register_nack_callback(MBG_MSG_CTL *pmctl, MBG_NACK_HANDLER_FNC *fnc)
Register a NACK message handler callback function.
int mbgextio_set_utc_parm(MBG_MSG_CTL *pmctl, XBP_ADDR *p_addr, const UTC *p)
Write a UTC parameter structure to a device.
int check_transfer(MBG_MSG_RCV_CTL *prctl, uint8_t c)
Check an incoming data stream for a binary message.
XDEVFEAT_CHK_SUPP_FNC xdevfeat_supp_tlv_time_monitor_license
Check if a device supports Time Monitor License infos via TLV.
int mbgextio_get_ntp_misc_orphan_mode_info(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, NTP_MISC_ORPHAN_MODE_INFO *p)
Read the NTP orphan mode information in NTP_MISC_ORPHAN_MODE_INFO format.
see USER_SCOPE_CONFIG_WRITE
#define _mbg_swab_user_info_idx(_p)
(rw-) MBG_PTP_V1_CURRENT_DATASET, only supp. if PTP_CFG_MSK_HAS_V1_COMMON_DATASETS is set in PTP_CFG_...
(r–) XBP_NODE_INFO_IDX, 0..XBP_NODE_LIMITS::node_count-1 instances can be retrieved ...
#define _mbg_swab_mbg_led_settings_idx(_p)
int mbgextio_get_receiver_info(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, RECEIVER_INFO *p)
Read a receiver info structure.
MBG_XFEATURE_BUFFER xfeature_buffer
Extended features provided by the device.
MBG_LNE_PORT_SETTINGS_IDX lne_port_settings_idx
uint16_t ANT_CABLE_LEN
A data type used to configure the length of an antenna cable [m].
(rw-) POUT_SETTINGS_IDX, programmable pulse output settings, only if RECEIVER_INFO::n_prg_out > 0 ...
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_ucap
Check if a device supports the user capture API.
#define MBGEXTIO_MSG_TIMEOUT_USB
(rwa) SCU_STAT_SETTINGS/SCU_STAT_INFO, SCU board control, only if ::GPS_MODEL_IS_SCU ...
int mbgextio_set_gnss_mode_settings(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const MBG_GNSS_MODE_SETTINGS *p)
Write GNSS mode settings.
#define MBG_SOCKET_ERR_RETVAL
The return code of socket functions in case of error.
(r–) MBG_NET_INTF_LINK_INFO_IDX, link status, only if MBG_NET_GLB_SUPP_STAGE_2_MASK is set in MBG_NE...
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_ntp
Check if a device supports the NTP API.
A structure to used to query the current configuration and capabilities of a PTP port.
MBG_SERVICE_SETTINGS settings
#define MBG_ERR_NO_ENTITY
no such file or directory
int mbgextio_fw_ufu_flash(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const MBG_FW_UFU_FLASH_CMD *p)
Send UFU flash instruction(s)
(r–) MBG_FW_INFO_IDX, with index 0 ... MBG_FW_GLB_INFO::installed_fws - 1
#define _mbg_swab_ntp_peer_state_idx(_p)
uint8_t state
The device state, see XBP_DEVICE_STATES.
int mbgextio_get_raw_irig_data(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_RAW_IRIG_DATA *p)
Read raw IRIG data.
PTP_UC_MASTER_SETTINGS settings
specification for the unicast master with that index
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_supp_tlv_fw_update
Check if a device supports a firmware update via TLV.
int xmt_tbuff(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr)
Complete message header and transmit message.
(rw-) MBG_SYSLOG_INFO_IDX / MBG_SYSLOG_SETTINGS_IDX, only supp. if MBG_MONITORING_TYPE_MSK_SYSLOG is ...
double XYZ[N_XYZ]
A position in cartesian coordinates.
Ionospheric correction parameters.
#define _mbg_swab_lan_if_info(_p)
int mbgextio_set_ntp_peer_settings_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const NTP_PEER_SETTINGS *p, uint16_t idx)
Send configuration settings for a specific NTP peer.
(r–) MBG_DEBUG_STATUS, only if GPS_HAS_DEBUG_STATUS
Specific FDM settings and limits.
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_pwr_ctl_api
Check if a device supports the power control API.
int mbgextio_set_ntp_clnt_mode_cfg(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const NTP_CLNT_MODE_SETTINGS *p)
Send the NTP client mode configuration.
(rw-) MBG_GPIO_SETTINGS_IDX, settings of a specific port, only if GPS_HAS_GPIO
(r–) MBG_GPIO_FREQ, only if MBG_IMS_STATE_FLAG_MSK_HAS_FDM is set in MBG_IMS_STATE::flags ...
#define _mbg_swab_mbg_ims_fdm_output_info_idx(_p)
#define _mbg_swab_ttm(_p)
Index structure for PTPv2 port dataset.
MSG_HDR hdr
The message header.
(-w-) Send GPS command as payload, only supp. if MBG_XFEATURE_PUSH_MSGS
#define _mbg_swab_event_settings_idx(_p)
A structure used to transmit information on date and time.
MBG_TLV_INFO tlv_info
TLV info provided by a device.
Index structure for PTPv1 port dataset.
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_clk_res_info
#define _ttm_time_set_unavail(_t)
(r–) MBG_IMS_FDM_INFO, only if MBG_IMS_STATE_FLAG_MSK_HAS_FDM is set in MBG_IMS_STATE::flags ...
(-wa) TTM, current time or capture, or init board time
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_xbp
Check if a device supports the extended binary protocol (XBP) feature.
MBG_TIME_SCALE_SETTINGS time_scale_settings
int mbgextio_set_tzcode(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const TZCODE *p)
Set the local time conversion configuration in TZCODE format.
A generic message send and receive control structure.
#define _mbg_swab_mbg_ims_fdm_state(_p)
Generic state of an IMS device.
int mbgextio_reset_usb(const MBG_USB_DEV_INFO *mdev_info)
Reset an USB device in case that the open_usb function return MBG_ERR_BUSY.
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_tzdl
(r–) MBG_SERVICE_MGMT_INFO, only supp. if MBG_XFEATURE_SERVICE
(-w-) Transmit index of MBG_FW_INFO_IDX to be activated
int mbgextio_set_ptp_v1_default_dataset(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const MBG_PTP_V1_DEFAULT_DATASET *p)
Send PTPv1 default dataset to a device in MBG_PTP_V1_DEFAULT_DATASET format.
int mbgextio_get_gnss_sv_status_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, GNSS_SV_STATUS_IDX *p, uint16_t idx)
::TODO
(rw-) NTP_MISC_ORPHAN_MODE_SETTINGS, only if NTP_MISC_MSK_ORPHAN_MODE is set in NTP_MISC_LIMITS::supp...
int mbgextio_get_monitoring_limits(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_MONITORING_LIMITS *p)
Read the monitoring limits in MBG_MONITORING_LIMITS format.
(r–) MBG_IMS_SENSOR_STATE_IDX, only if GPS_HAS_IMS
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_ims
#define _mbg_swab_synth(_p)
int mbgextio_set_event_settings_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const MBG_EVENT_SETTINGS *p, uint16_t idx)
Write monitoring event settings in MBG_EVENT_SETTINGS format.
A GPIO port's current settings, plus port index.
#define _mbg_swab_xbp_limits(_p)
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_supp_tlv_ptpv2_license
Check if a device supports upports PTPv2 license infos.
uint32_t XMR_HOLDOVER_INTV
XMR holdover interval, or elapsed holdover time, in [s].
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_ant_info
Check if a device supports the ANT_INFO structure and API.
(r–) NTP_SYMM_KEY_LIMITS, only if NTP_MSK_SYMM_KEYS is set in NTP_SRV_MODE_SETTINGS::flags ...
int mbgextio_set_led_settings_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const MBG_LED_SETTINGS *p, uint16_t idx)
Write a MBG_LED_SETTINGS parameter structure to a device.
MBG_PTP_V1_PORT_DATASET port_dataset
see MBG_PTP_V1_PORT_DATASET
int mbgextio_get_iono(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, IONO *p)
Read the ionospheric correction parameters from a device.
int mbgextio_get_str_type_info_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, STR_TYPE_INFO_IDX *p, uint16_t idx)
Read information on a specific supported string format.
void lla_to_dms(POS *pos)
Convert mathematic coords to to geographic coords.
int mbgextio_get_net_dns_srch_dom_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_NET_NAME_IDX *p, uint16_t idx)
Read the network DNS search domain in MBG_NET_NAME_IDX format.
#define _mbg_swab_ptp_v1_parent_dataset(_p)
int mbgextio_get_svc_info_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_SERVICE_INFO_IDX *p, uint16_t idx)
Read the service info with the given index in MBG_SERVICE_INFO_IDX format.
MBG_NET_GLB_CFG_SETTINGS net_glb_cfg_settings
int mbgextio_set_synth(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const SYNTH *p)
Write the frequency synthesizer settings.
int mbgextio_clr_evt_log(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr)
Clear the on-board event log.
Global configuration info of an NTP device (client/server)
Limits to be considered when specifying PTP unicast masters.
MBG_ASYNC_DATA_HANDLER_FNC * async_data_handler_fnc
See mbgextio_register_async_data_callback.
int mbgextio_get_ip4_settings(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, IP4_SETTINGS *p)
Read the lan ipv4 configuration state IP4_SETTINGS format.
#define _mbg_swab_ptp_v2_default_dataset(_p)
int mbgextio_get_port_parm(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, PORT_PARM *p)
Read serial port parameters in PORT_PARM format.
ulong mbgextio_set_dev_poll_timeout(MBG_MSG_CTL *pmctl, ulong new_timeout)
Set device poll timeout.
MBG_USER_STATUS user_status
User status for the logged in user.
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_fw_mngmnt
Check if a device supports the FW management API.
(-w-) Send GPS command as payload, only supp. if MBG_XFEATURE_PUSH_MSGS
int mbgextio_set_hq_tx_settings(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const HAVEQUICK_SETTINGS *p)
Send new configuration settings for the device's HAVEQUICK output.
int mbgextio_get_event_info_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_EVENT_INFO_IDX *p, uint16_t idx)
Read monitoring event info in MBG_EVENT_INFO_IDX format.
int mbgextio_get_fw_ufu_info_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_FW_UFU_INFO_IDX *p, uint8_t fw_idx, uint8_t ufu_idx)
Read the firmware ufu info of the given firmware with the also given index in MBG_FW_UFU_INFO_IDX for...
MBG_SNMP_V12_TRAP_SETTINGS_IDX snmp_v12_trap_settings_idx
#define _mbg_swab_ucap_net_recv_info_idx(_p)
(r–) MBG_TAINTED_CFG, only supp. if MBG_XFEATURE_TAINTED_CFG is set in extended features ...
int mbgextio_set_net_dns_srch_dom_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const MBG_NET_NAME *p, uint16_t idx)
Send the network DNS search domain in MBG_NET_NAME format.
MBG_SYSLOG_SETTINGS settings
Satellite information for a particular GNSS type.
Clock resolution information.
#define _mbg_swab_stat_info(_p)
#define _mbg_swab_gnss_sat_info(_p)
NTP_CLNT_MODE_SETTINGS ntp_clnt_mode_settings
#define MBG_ERR_IO
Input/output error.
#define _mbg_swab_ptp_v1_port_dataset_idx(_p)
int mbgextio_set_ucap_net_glb_settings(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const MBG_UCAP_NET_GLB_SETTINGS *p)
Send the user capture network global configuration in MBG_UCAP_NET_GLB_SETTINGS format.
int mbgextio_set_ntp_misc_orphan_mode_settings(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const NTP_MISC_ORPHAN_MODE_SETTINGS *p)
Send the NTP orphan mode configuration in NTP_MISC_ORPHAN_MODE_SETTINGS format.
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_xbp
Check if a device supports the extended binary protocl (XBP) feature.
int mbgextio_get_time_scale_info(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_TIME_SCALE_INFO *p)
Read time scale configuration parameters.
(r–) MBG_FW_GLB_INFO, only supp. if MBG_XFEATURE_FW_MNGMNT is set
An IPv4 or IPv6 network address, plus index.
#define MBG_ERR_UNSPEC
Unspecified error.
(-w-) MBG_DATABASE_CMD, only supp. if MBG_XFEATURE_DATABASE
#define _mbg_swab_ntp_refclk_state_idx(_p)
#define MBG_ERR_BYTES_WRITTEN
Binary protocol failed to write all bytes.
int mbgextio_set_xmr_settings_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const XMULTI_REF_SETTINGS *p, uint16_t idx)
Set XMULTI_REF_SETTINGS for a specific XMR source.
MBG_NET_INTF_LINK_SETTINGS settings
int mbgextio_get_lne_limits(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_LNE_LIMITS *p)
Read a MBG_IMS_FDM_STATE parameter structure from a device. ::TODO ###.
Configuration settings for a specific programmable pulse output.
(rw-) XMR_HOLDOVER_INTV, only if ::GPS_MODEL_HAS_XMR_HOLDOVER_INTV, see also GPS_XMR_HOLDOVER_STATUS ...
Structure for monitoring event settings.
#define _mbg_swab_double(_p)
(rw-) MBG_USER_INFO_IDX / MBG_USER_SETTINGS_IDX, index 0 .. MBG_USER_MNGMNT_SETTINGS::num_levels, only supp. if MBG_XFEATURE_USER_MNGMNT
#define MBG_DEFAULT_BAUDRATE
The standard baud rate used for the binary protocol.
int mbgextio_get_pout_info_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, POUT_INFO_IDX *p, uint16_t idx)
Read current settings and capabilities of a specific programmable pulse output.
int mbgextio_get_lne_port_settings_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_LNE_PORT_SETTINGS_IDX *p, uint16_t idx)
Read a MBG_LNE_PORT_SETTINGS_IDX parameter structure from a device.
A structure used to configure optional settings.
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_led_api
Check if a device supports the LED API.
XMULTI_REF_SETTINGS settings
the settings configured for this level
#define _mbg_swab_ip4_settings(_p)
MBG_DATABASE_SETTINGS_IDX db_settings_idx
int mbgextio_clr_ucap_buff(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr)
Clear the user capture event buffer on-board the device.
int16_t MBG_REF_OFFS
A data type used to configure the ref offset.
#define GPS_CTRL_MSK
bit mask of all GPS_CMD_CTRL_CODES
#define MBGEXTIO_POLL_TIMEOUT_SERIAL
#define _mbg_swab_mbg_gnss_mode_info(_p)
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_cmd_save_cfg
Check if a device supports the GPS_SAVE_CFG command.
MBG_PTP_V2_CURRENT_DATASET ptp_v2_current_dataset
int mbgextio_get_ucap_net_recv_info_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_UCAP_NET_RECV_INFO_IDX *p, uint16_t idx)
Read the user capture network receiver info with the given index in MBG_UCAP_NET_RECV_INFO_IDX format...
uint16_t idx
0..MBG_NET_GLB_CFG_SETTINGS::num_intf_route-1
(rw-) MBG_NET_INTF_ADDR_INFO_IDX/MBG_NET_INTF_ADDR_SETTINGS_IDX, only if MBG_NET_GLB_SUPP_STAGE_2_MAS...
int mbgextio_get_user_info_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_USER_INFO_IDX *p, uint16_t idx)
Read the user info with the given index in MBG_USER_INFO_IDX format.
int mbgextio_socket_read_default(MBG_MSG_CTL *pmctl, void *buf, size_t len)
Function, which can be used to read data from a standard LAN socket.
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_service
Check if a device supports services.
int mbgextio_get_serial_ftdi_port_handle(MBG_MSG_CTL *pmctl)
Get the port handle of a serial FTDI device.
int mbgextio_set_ucap_net_recv_settings_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const MBG_UCAP_NET_RECV_SETTINGS_IDX *p, uint16_t idx)
Send the user capture network receiver configuration with the given index in MBG_UCAP_NET_RECV_SETTIN...
Global settings, features and flags for user captures via network.
#define MBG_IO_PORT_SETTINGS_IDX_SIZES
#define _mbg_swab_mbg_opt_settings(_p)
int mbgextio_get_num_evt_log_entries(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_NUM_EVT_LOG_ENTRIES *p)
Read the current number of entries in the on-board event log.
MBG_IMS_FDM_SETTINGS fdm_settings
int mbgextio_get_net_stat_glb_cfg_info(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_NET_GLB_CFG_INFO *p)
Read the network global status information MBG_NET_GLB_CFG_INFO format.
Link (physical interface) specific settings, plus index.
uint16_t idx
the priority level index (highest == 0), 0..XMULTI_REF_INSTANCES::n_xmr_settings-1 ...
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_pzf
Check if a device supports DCF77 PZF decoding.
#define _mbg_swab_mbg_num_evt_log_entries(_p)
Information on a specific XBP node.
MBG_USER_MNGMNT_SETTINGS user_mngmnt_settings
(rw-) HAVEQUICK_SETTINGS for output, only if GPS_HAS_HAVEQUICK
#define _mbg_swab_snmp_v3_trap_info_idx(_p)
int _MBG_API MBG_ASYNC_DATA_HANDLER_FNC(MBG_MSG_CTL *pmctl, char c)
Type of a callback function to handle spurious asynchronous data bytes.
int mbgextio_set_enable_flags(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const ENABLE_FLAGS *p)
Send the enable flags controlling when output signals are enabled.
(-w-) NANO_TIME_64, set time deviation, only if MBG_IMS_FDM_FLAG_MASK_CAN_SET_TDEV ...
#define _mbg_swab_ucap_net_recv_settings_idx(_p)
#define _mbg_swab_ptp_state(_p)
(rw-) MBG_PTP_V2_PORT_DATASET_IDX, only supp. if PTP_CFG_MSK_HAS_V2_COMMON_DATASETS is set in PTP_CFG...
#define DEFAULT_GPS_TICKS_PER_SEC
system time base, see GPS_TICKS_PER_SEC
(r–) GNSS_SV_STATUS_IDX, only supp. if MBG_GNSS_FLAG_MSK_HAS_SV_STATUS is set
see USER_SCOPE_CONFIG_READ
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_database
Check if a device supports database(s) feature.
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_time_scale
Check if a device supports the MBG_TIME_SCALE_INFO structure and API.
int decrypt_message(MBG_MSG_CTL *pmctl)
Decrypt an encrypted binary message.
General info on supported XMR sources and instances.
int mbgextio_set_ntp_glb_info(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const NTP_GLB_SETTINGS *p)
Send the NTP global configuration.
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_tzdl
Check if a device supports the TZDL structure and API.
int mbgextio_delete_fw(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, uint16_t idx)
Delete the firmware with the given index.
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_xmulti_ref
Check if a device supports the up-to-date extended multi ref API.
int mbgextio_time_mon_get_target_status_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_TIME_MON_TARGET_STATUS_IDX *p, uint16_t idx)
int mbgextio_get_ptp_smpte_tlv_state(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, PTP_SMPTE_PROFILE_CFG *p)
Read the current SMPTE TLV.
void mbgextio_register_async_data_reset_callback(MBG_MSG_CTL *pmctl, MBG_ASYNC_DATA_RESET_FNC *fnc)
Register an asynchronous data reset callback function.
int mbgextio_setup_xdevfeat(MBG_MSG_CTL *pmctl, XBP_ADDR *addr)
Set up MBG_XDEV_FEATURES for a device which has just been opened.
ANT_CABLE_LEN ant_cable_len
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_lne_api
Check if a device supports the LNE API.
#define _mbg_mutex_release(_pm)
(r–) MBG_FW_UFU_INFO_IDX, with index 0 ... MBG_FW_INFO::num_ufus - 1
int mbgextio_set_ntp_symm_key_settings_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const NTP_SYMM_KEY_SETTINGS *p, uint16_t idx)
Send NTP symmetric key settings with the given index in NTP_SYMM_KEY_SETTINGS format.
Network host or domain name, plus index.
General LED info to be read from a device.
XMULTI_REF_INFO_IDX xmulti_ref_info_idx
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_lan_ip4
Check if a device supports the old LAN_IP4 API.
(rw-) PORT_SETTINGS_IDX, settings for specified serial port, only if RECEIVER_INFO::n_com_ports > 0 ...
#define _mbg_swab_ntp_trusted_key_info_idx(_p)
(rw-) XYZ, current position in ECEF coordinates, only if GPS_MODEL_HAS_POS_XYZ
int mbgextio_set_snmp_v3_trap_settings_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const MBG_SNMP_V3_TRAP_SETTINGS *p, uint16_t idx)
Write SNMP v3 trap settings in MBG_SNMP_V3_TRAP_SETTINGS format.
A structure used to control the reception of binary messages.
#define MBG_ERR_HDR_CSUM
Binary protocol header checksum error.
int mbgextio_get_led_limits(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_LED_LIMITS *p)
Read the MBG_LED_LIMITS to check how many LEDs are provided.
Structure for monitoring event info.
#define _mbg_swab_mbg_gpio_settings_idx(_p, _recv)
(r–) NTP_MISC_LIMITS, only if NTP_MSK_MISCELLANEOUS is set in NTP_GLB_INFO::supp_flags ...
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_tlv_api
Check if a device supports the TLV API.
int mbgextio_find_lan_devices(MBG_LAN_DEV_LIST **list, uint16_t timeout_ms)
Sets up a list of all available Meinberg LAN devices in the network.
int mbgextio_get_led_info_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_LED_INFO_IDX *p, uint16_t idx)
Read the current settings and features of a particular LED.
int mbgextio_set_pos_lla(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const LLA lla)
Set the device's position by sending an LLA array.
(r–) POUT_INFO_IDX, programmable pulse output settings and capabilities, only if RECEIVER_INFO::n_pr...
NTP_GLB_SETTINGS ntp_glb_settings
uint32_t cmd
See MBG_DATABASE_CMDS.
#define _mbg_swab_irig_info(_p)
int mbgextio_get_ntp_trusted_key_info_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, NTP_TRUSTED_KEY_INFO_IDX *p, uint16_t idx)
Read the NTP trusted key info with the given index in NTP_TRUSTED_KEY_INFO_IDX format.
(rw-) MBG_PTP_V2_TIME_PROPERTIES_DATASET, only supp. if PTP_CFG_MSK_HAS_V2_COMMON_DATASETS is set in ...
#define _mbg_swab_port_parm(_p)
Settings for receivers of user captures via network.
int mbgextio_set_irig_tx_settings(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const IRIG_SETTINGS *p)
Send new configuration settings for the device's IRIG output.
#define _mbg_swab_mbg_ims_fdm_info(_p)
MBG_USER_PERM_BUF cfg_read_perm
current config read permissions, see MBG_USER_PERM_BUF and MBG_USER_PERMS
(r–) MBG_NUM_EVT_LOG_ENTRIES, num. of log entries, only if GPS_HAS_EVT_LOG
int mbgextio_get_ucap_net_glb_info(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_UCAP_NET_GLB_INFO *p)
Read the user capture network global info in MBG_UCAP_NET_GLB_INFO format.
(r–) MBG_RAW_IRIG_DATA, only if GPS_HAS_RAW_IRIG_DATA
(r–) MBG_USER_STATUS for the authenticated user, see MBG_XFEATURE_USER_AUTH
#define _mbg_swab_fw_glb_info(_p)
MBG_PTP_V2_PARENT_DATASET ptp_v2_parent_dataset
int mbgextio_set_database_settings_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const MBG_DATABASE_SETTINGS *p, uint8_t idx)
Write database settings in MBG_DATABASE_SETTINGS_IDX format.
Configuration settings specifiying how to query a PTP unicast master.
(rw-) XMULTI_REF_SETTINGS_IDX, idx 0..XMULTI_REF_INSTANCES::n_xmr_settings-1, only if GPS_HAS_XMULTI_...
#define MBG_ERR_NO_MEM
Failed to allocate memory.
encrypted transmission, usually over network
void mbg_gps_ident_decode(char *s, const IDENT *p_id)
(rw-) MBG_PTP_V1_TIME_PROPERTIES_DATASET, only supp. if PTP_CFG_MSK_HAS_V1_COMMON_DATASETS is set in ...
XDEVFEAT_CHK_SUPP_FNC xdevfeat_is_gnss
Check if a device supports the GNSS API.
#define MBG_ERR_RCVD_NACK
Binary protocol received reply msg with a NACK code.
int mbgextio_time_mon_get_target_ext_data_set_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_TIME_MON_TARGET_EXT_DATA_SET_IDX *p, uint16_t idx)
int mbgextio_set_holdover_interval(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const XMR_HOLDOVER_INTV *p)
Set the XMR holdover interval.
One of several sets of satellite information for a particular GNSS type.
(rw-) IGNORE_LOCK, if != 0 always claim to be sync, only if GPS_HAS_IGNORE_LOCK
int mbgextio_get_ims_fdm_output_state_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_IMS_FDM_OUTPUT_STATE_IDX *p, uint16_t idx)
Read a MBG_IMS_FDM_OUTPUT_STATE_IDX parameter structure from a device.
#define MBG_ERR_ACCESS
Access denied, e.g. when trying to access a file or device without sufficient permissions.
int mbgextio_set_port_settings_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const PORT_SETTINGS *p, uint16_t idx)
Send configuration settings for a specific serial port.
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_bvar_stat
Check if a device supports the BVAR_STAT structure and API.
int mbgextio_set_scu_stat_settings(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const SCU_STAT_SETTINGS *p)
Send SCU_STAT_SETTINGS to the device.
void trim_whitespace(char *s)
Trim both leading and trailing whitespace from a string.
#define MBG_ERR_NBLOCK_WAIT_WR_FD
Write fd not set after select when waiting for non-blocking network port to become ready...
(rw-) MBG_PTP_V1_DEFAULT_DATASET, only supp. if PTP_CFG_MSK_HAS_V1_COMMON_DATASETS is set in PTP_CFG_...
(rw-) MBG_SNMP_GLB_INFO / MBG_SNMP_GLB_SETTINGS, only supp. if MBG_MONITORING_TYPE_MSK_SNMP is set in...
int mbgextio_get_ptp_v1_parent_dataset(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_PTP_V1_PARENT_DATASET *p)
Read the PTPv1 parent dataset in MBG_PTP_V1_PARENT_DATASET format.
int mbgextio_get_tr_distance(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, TR_DISTANCE *p)
Read the distance from transmitter TR_DISTANCE format.
the number of known baud rates
MBG_EVENT_SETTINGS settings
int mbgextio_get_ntp_symm_key_limits(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, NTP_SYMM_KEY_LIMITS *p)
Read the NTP symmetric key limits in NTP_SYMM_KEY_LIMITS format.
int MBG_TIME_MON_TARGET_SETTINGS
MBG_ASYNC_MSG_HANDLER_FNC * async_msg_handler_fnc
See mbgextio_register_async_msg_callback.
Time zone / daylight saving parameters.
#define _mbg_swab_str_type_info_idx(_p)
MBG_NET_INTF_ADDR_SETTINGS_IDX net_intf_addr_settings_idx
uint32_t device_flags
See MSG_CTL_DEVICE_FLAG_MSKS.
PORT_SETTINGS port_settings
int mbgextio_set_gpio_settings_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const MBG_GPIO_SETTINGS *p, uint16_t idx)
Send configuration settings for a specific GPIO.
int mbgextio_get_ims_sensor_state_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_IMS_SENSOR_STATE_IDX *p, uint16_t idx)
Read sensor values from a specified sensor on the device.
int mbgextio_get_pos(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, POS *p_pos)
Read the current receiver position as POS structure.
(r–) LAN_IF_INFO, only if GPS_HAS_LAN_IP4
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_ucap_net
Check if a device supports the user capture via network feature.
int mbgextio_xmt_cmd_us(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, GPS_CMD cmd, uint16_t us)
Transmit a message with a single ushort (uint16_t) parameter.
#define MBG_SUCCESS
Error codes used with Meinberg devices and drivers.
void mbg_memcpy(void *dst, const void *src, size_t n_bytes)
Copy array of bytes starting at beginning of buffer.
#define _mbg_swab_enable_flags(_p)
#define _mbg_swab_xmulti_ref_info_idx(_p)
int mbgextio_close_connection(MBG_MSG_CTL **ppmctl)
Close a binary communication channel and release resources.
MBG_UCAP_NET_GLB_SETTINGS ucap_net_glb_settings
int mbgextio_set_ref_offs(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const MBG_REF_OFFS *p)
Send new ref offset to UTC settings.
uint16_t idx
Index of the port dataset, 0..MBG_PTP_V1_DEFAULT_DATASET::number_ports - 1.
#define _mbg_swab_pout_info_idx_on_get(_p)
int mbgextio_get_cfgh(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, CFGH *p)
Read configuration and health data of all satellites from a device.
MBG_SYSLOG_GLB_SETTINGS syslog_glb_settings
(rw-) MBG_PTP_V2_CURRENT_DATASET, only supp. if PTP_CFG_MSK_HAS_V2_COMMON_DATASETS is set in PTP_CFG_...
MBG_PTP_V1_CURRENT_DATASET ptp_v1_current_dataset
MSG_CTL_DEVICE_FLAG_MSKS
Binary message control device flag masks.
int mbgextio_set_port_parm(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const PORT_PARM *p)
Send serial port parameters in PORT_PARM format.
#define GPS_MODEL_NAME_CPC_01
(r–) MBG_IO_PORT_LIMITS, only supp. if MBG_XFEATURE_IO_PORTS is set in extended features ...
(r–) GPS_XMR_METRICS_IDX, only if XMR_EXT_SRC_FEAT_FLAG_MSK_METRICS
int mbgextio_get_synth(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, SYNTH *p)
Read the frequency synthesizer settings.
MBG_IMS_FDM_OUTPUT_SETTINGS_IDX fdm_output_settings_idx
Peer settings for NTP devices.
XDEVFEAT_CHK_SUPP_FNC xdevfeat_supp_tlv_exec_cmd
Check if a device supports a command execution via TLV.
GPS_CMD cmd
see GPS_CMD_CODES and GPS_CMD_CTRL_CODES
MBG_STD_MSG std_msg
Encapsulated standard binary message.
Synthesizer configuration parameters.
MBG_USER_INFO user_info
User info for the logged in user.
int mbgextio_get_snmp_v12_info_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_SNMP_V12_INFO_IDX *p, uint16_t idx)
Read SNMP v1 or v2 info in MBG_SNMP_V12_INFO_IDX format.
int mbgextio_set_syslog_settings_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const MBG_SYSLOG_SETTINGS *p, uint16_t idx)
Write syslog server information in MBG_SYSLOG_SETTINGS_IDX format.
Generic state of an IMS sensor, with sensor index.
int mbgextio_set_ntp_trusted_key_settings_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const NTP_TRUSTED_KEY_SETTINGS *p, uint16_t idx)
Send NTP trusted key settings with the given index in NTP_TRUSTED_KEY_SETTINGS format.
int mbgextio_set_syslog_glb_settings(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const MBG_SYSLOG_GLB_SETTINGS *p)
Send the syslog global settings in MBG_SYSLOG_GLB_SETTINGS format.
int mbgextio_setup_receiver_info(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, RECEIVER_INFO *p)
Setup a receiver info structure.
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_synth
Reference source capabilities and current configuration for a specific priority level.
int mbgextio_send_database_cmd(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, uint32_t cmd, const void *payload, uint32_t payload_len)
Send a specific command to database in MBG_DATABASE_CMD format.
MSG_DATA msg_data
Standard message data structures.
#define _mbg_swab_ntp_refclk_cfg_info_idx(_p)
#define _mbg_swab_ntp_misc_limits(_p)
uint32_t idx
node index, 0..XBP_NODE_LIMITS::node_count-1
XBP_PORT addr[7]
An array of port numbers on cascaded controllers.
int mbgextio_set_svc_ctl_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, uint16_t idx, uint16_t ctl)
Set service control command.
#define _mbg_swab_snmp_glb_info(_p)
#define MAX_XBP_CASC_LVL
Maximum XBP bus/controller cascading level.
int mbgextio_set_ims_fdm_output_settings_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const MBG_IMS_FDM_OUTPUT_SETTINGS *p, uint16_t idx)
Write a MBG_IMS_FDM_OUTPUT_SETTINGS parameter structure to a device.
Network host or domain name.
A geographic position represented in different formats.
A buffer used to read raw IRIG data bits from an IRIG receiver.
(r–) MBG_USER_STATUS_IDX, index 0 .. MBG_USER_MNGMNT_SETTINGS::num_users, only supp. if MBG_XFEATURE_USER_MNGMNT
int mbgextio_get_ptp_v1_default_dataset(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_PTP_V1_DEFAULT_DATASET *p)
Read the PTPv1 default dataset in MBG_PTP_V1_DEFAULT_DATASET format.
#define _mbg_swab_ant_cable_len(_p)
unsigned char payload[240]
Payload data.
MBG_IO_PORT_SETTINGS settings
int mbgextio_set_active_fw(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, uint16_t idx)
Activate the firmware with the given index.
PTPv1 default dataset containing global information about the device.
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_ant_info
(r–) XMR_HOLDOVER_STATUS, only if XMRIF_MSK_HOLDOVER_STATUS_SUPP, deprecates GPS_XMR_HOLDOVER_ELAPSE...
#define _mbg_mutex_init(_pm, _n)
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_gnss_mode
Check if a device supports GNSS mode feature All GNSS receivers support this feature by default...
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_cmd_save_cfg
Check if a device supports the GPS_SAVE_CFG command.
#define GPS_HAS_XFEATURE
see GPS_FEAT_XFEATURE
MBG_GPIO_SETTINGS settings
current settings
#define _mbg_swab_port_settings_idx(_p)
int mbgextio_set_net_intf_link_settings_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const MBG_NET_INTF_LINK_SETTINGS *p, uint16_t idx)
Send the network link configuration in MBG_NET_INTF_LINK_SETTINGS format.
(rw-) IRIG_SETTINGS, only if GPS_HAS_IRIG_TX
(rw-) reserved for public key LAN interface
#define _mbg_swab_mbg_ims_sensor_state_idx(_p)
int mbgextio_get_net_stat_intf_route_info_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_NET_INTF_ROUTE_INFO_IDX *p, uint16_t idx)
Read MBG_NET_INTF_ROUTE_INFO_IDX from the status with the given index.
(r–) XBP_NODE_LIMITS, only if XBP_FEAT_MASK_NODES is set in XBP_LIMITS::features ...
#define MBG_ERR_BUSY
Device or resource busy, can't be used.
int MBG_TIME_MON_TARGET_STATUS_IDX
Server settings of an NTP device.
const char * mbg_framing_strs[N_MBG_FRAMINGS]
uint16_t idx
the priority level index (highest == 0), 0..XMULTI_REF_INSTANCES::n_xmr_settings-1 ...
(rw-) IONO, GPS ionospheric correction parameters
MBG_ASYNC_DATA_RESET_FNC * async_data_reset_fnc
See mbgextio_register_async_data_reset_callback.
int mbgextio_get_ims_fdm_output_info_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_IMS_FDM_OUTPUT_INFO_IDX *p, uint16_t idx)
Read a MBG_IMS_FDM_OUTPUT_INFO_IDX parameter structure from a device.
(r–) STAT_INFO, satellite info, mode of operation, and DAC info, only if GPS_MODEL_HAS_STAT_INFO ...
(rw-) MBG_IMS_FDM_SETTINGS, only if MBG_IMS_STATE_FLAG_MSK_HAS_FDM is set in MBG_IMS_STATE::flags ...
see MSG_CTL_DEVICE_FLAG_LEGACY
XDEVFEAT_CHK_SUPP_FNC xdevfeat_supp_tlv_file_req
Check if a device supports a file request via TLV.
PZF correlation status info.
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_is_legacy
Check if a device is a legacy device.
int mbgextio_get_ptp_cfg_info(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, PTP_CFG_INFO *p)
Read the ptp configuration PTP_CFG_INFO format.
(r–) IRIG_INFO, only if GPS_HAS_IRIG_TX
(r–) MBG_TIME_MON_TARGET_STATUS_IDX
uint16_t idx
0..MBG_LED_LIMITS::num_leds-1
(rw-) MBG_OPT_SETTINGS, only if GPS_HAS_OPT_SETTINGS
#define _mbg_swab_tr_distance(_p)
MBG_NACK_HANDLER_FNC * nack_handler_fnc
See mbgextio_register_nack_callback.
MBG_USER_SETTINGS settings
settings, see MBG_USER_SETTINGS
XYZ xyz
Always WGS84 ECEF coordinates.
#define MBG_IO_PORT_INFO_IDX_MIN_SIZE
MBG_DATABASE_SETTINGS settings
int mbgextio_set_snmp_v3_settings_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const MBG_SNMP_V3_SETTINGS *p, uint16_t idx)
Write SNMP v3 settings in MBG_SNMP_V3_SETTINGS format.
#define MBG_ERR_INV_SOCK_FD
Invalid socket when tried to open network socket.
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_up_conv
Check if the device has an L1 frequency up converter.
#define _mbg_swab_irig_settings(_p)
POUT_SETTINGS_IDX pout_settings_idx
int mbgextio_set_ptp_v2_time_properties_dataset(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const MBG_PTP_V2_TIME_PROPERTIES_DATASET *p)
Send PTPv2 time properties dataset to a device in MBG_PTP_V2_TIME_PROPERTIES_DATASET format...
An SV number plus the SV's almanac data.
#define _mbg_swab_ptp_cfg_settings(_p)
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_tzcode
Check if a device supports the TZCODE API.
MBG_SNMP_V3_SETTINGS settings
#define _mbg_swab_xbp_node_limits(_p)
#define _mbg_swab_ntp_trusted_key_settings_idx(_p)
static const char force_conn_cmd_str[]
#define _setup_default_receiver_info_gps(_p)
Initialize a RECEIVER_INFO structure for legacy GPS receivers.
RECEIVER_INFO receiver_info
Receiver info provided by the device.
#define _mbg_swab_net_intf_link_info_idx(_p)
#define _mbg_swab_ptp_uc_master_cfg_limits(_p)
int mbgextio_get_xmr_ext_source_stats_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, XMR_STATS_IDX *p, uint16_t idx)
Read XMR_STATS_IDX for a specific XMR source.
#define _mbg_swab_user_mngmnt_settings(_p)
(r–) PTP_SMPTE_PROFILE_CFG, only supp. if PTP_CFG_MSK_HAS_SMPTE_TLV_STATE is set in PTP_CFG_INFO::su...
Reference source configuration settings.
int mbgextio_get_net_stat_intf_addr_info_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_NET_INTF_ADDR_INFO_IDX *p, uint16_t idx)
Read MBG_NET_INTF_ADDR_INFO_IDX from the status with the given index.
#define _mbg_swab_ptp_v2_parent_dataset(_p)
A buffer for a message header plus data part.
int mbgextio_set_ptp_v2_parent_dataset(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const MBG_PTP_V2_PARENT_DATASET *p)
Send PTPv2 parent dataset to a device in MBG_PTP_V2_PARENT_DATASET format.
int mbgextio_open_usb_ldev(libusb_device *ldev, MBG_MSG_CTL **ppmctl)
Open a binary communication channel using direct USB I/O.
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_supp_tlv_ufu
Check if a device supports a UFU (Unified Firmware Update) via TLV.
(r–) MBG_NET_INTF_ROUTE_INFO_IDX, route status, only if MBG_NET_GLB_SUPP_STAGE_2_MASK is set in MBG_...
#define _mbg_swab_ntp_peer_settings_idx(_p)
int mbgextio_get_pos_xyz(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, XYZ xyz)
Read the current receiver position as XYZ array.
Received message was too long for the message receive buffer.
uint16_t SVNO
the number of an SV (Space Vehicle, i.e. satellite)
#define _mbg_swab_mbg_led_info_idx(_p)
XDEVFEAT_CHK_SUPP_FNC xdevfeat_supp_tlv_ufu
Check if a device supports UFU (Unified Firmware Update) via TLV.
NTP_SYMM_KEY_SETTINGS_IDX ntp_symm_key_settings_idx
uint16_t idx
0..MBG_NET_GLB_CFG_INFO::n_supp_intf_link-1
uint16_t idx
0..MBG_NET_GLB_CFG_SETTINGS::num_intf_addr-1
#define _mbg_swab_syslog_settings_idx(_p)
#define _mbg_swab_svc_info_idx(_p)
#define _mbg_swab_xmr_metrics_idx(_p)
int mbgextio_get_ant_cable_len(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, ANT_CABLE_LEN *p)
Read the configured length of the antenna cable.
Satellite receiver status information.
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_supp_tlv_file_req
Check if a device supports file request via TLV.
(rw-) MBG_PWR_CTL, set or retrieve device power state, only if MBG_XFEATURE_PWR_CTL_API ...
(rw-) IP4_SETTINGS, only if GPS_HAS_LAN_IP4
void swap_double(double *p)
Swap the bytes of a single variable of type "double".
Waiting for a binary message, i.e. no START_OF_HEADER received, yet.
#define _mbg_swab_tzdl(_p)
(r–) CORR_INFO, correlation info, only if GPS_MODEL_IS_DCF_PZF
#define _mbg_swab_ptp_v2_time_properties_dataset(_p)
int mbgextio_xmt_cmd(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, GPS_CMD cmd)
Transmit a command-only message without additional data.
#define MBG_ERR_PERM
Operation not permitted, e.g. when trying to set the system time without sufficient permissions...
MBG_PTP_V1_TIME_PROPERTIES_DATASET ptp_v1_time_properties_dataset
int mbgextio_open_serial_force_default(const char *dev, MBG_MSG_CTL **ppmctl, uint32_t baud_rate, const char *framing)
Open a binary communication channel forcing default serial parameters.
#define _mbg_swab_snmp_v3_trap_settings_idx(_p)
NTP_SYMM_KEY_SETTINGS settings
#define MBG_IO_PORT_TYPE_INFO_IDX_MIN_SIZE
Software revision information.
int xmt_cmd_u32(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, GPS_CMD cmd, uint32_t u32)
Send a binary command message with 32 bit parameter.
#define _mbg_mutex_acquire(_pm)
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_push_msgs
#define _mbg_swab_fw_info_idx(_p)
int mbgextio_get_svc_mgmt_info(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_SERVICE_MGMT_INFO *p)
Read service management info in MBG_SERVICE_MGMT_INFO format.
A structure used to report XBP features and limits.
int mbgextio_get_bvar_stat(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, BVAR_STAT *p)
Read the status of buffered variables.
#define _mbg_swab_mbg_ims_fdm_output_state_idx(_p)
Current settings and general capabilities of a specific serial port.
#define _mbg_swab_net_intf_route_settings_idx(_p)
int mbg_ftdi_ft_status_to_mbg(int status)
Translate a FTDI API status code to one of the MBG_ERROR_CODES.
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_monitoring
Check if a device supports the extended feature monitoring.
(rw-) deprecated, PORT_PARM, use PORT_SETTINGS etc. if GPS_RECEIVER_INFO supported ...
int mbgextio_set_svc_settings_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const MBG_SERVICE_SETTINGS *p, uint16_t idx)
Write service settings in MBG_SERVICE_SETTINGS_IDX format.
uint8_t bytes[(sizeof(MSG_DATA)+0)]
Data part as a number of bytes.
(rw-) MBG_SERVICE_INFO_IDX / MBG_SERVICE_SETTINGS_IDX, index 0 .. MBG_SERVICE_MGMT_INFO::num_services...
NTP_PEER_SETTINGS peer_settings
int mbgextio_set_io_port_settings_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const MBG_IO_PORT_SETTINGS *p, uint8_t idx)
Send I/O port settings in MBG_IO_PORT_SETTINGS format.
#define _mbg_swab_svc_mgmt_info(_p)
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_ext_sys_info
Check if a device has MBG_XFEATURE_EXT_SYS_INFO.
#define _mbg_swab_ntp_sys_state(_p)
void mbgextio_set_msg_rcv_timeout(MBG_MSG_CTL *pmctl, ulong new_timeout)
Set message receive timeout value.
LLA lla
Longitude, latitude and altitude, depending on the ellipsoid used for reference.
int mbgextio_get_ptp_v1_port_dataset_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_PTP_V1_PORT_DATASET_IDX *p, uint16_t idx)
Read the PTPv1 port dataset with the appropriate index in MBG_PTP_V1_PORT_DATASET_IDX format...
NTP_REFCLK_CFG_SETTINGS_IDX ntp_refclk_cfg_settings_idx
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_ptp
Check if a device supports the PTP API.
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_led_api
Check if a device supports the LED API.
int mbgextio_time_mon_get_inst_info(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_TIME_MON_INST_INFO *p)
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_tzcode
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_synth
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_ntp
Check if a device supports the NTP API.
(r–) MBG_IMS_STATE, only if GPS_HAS_IMS
#define _mbg_swab_mbg_lne_limits(_p)
#define _mbg_swab_snmp_v3_info_idx(_p)
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_is_gps
Check if a device can receive the GPS satellite system.
#define MBG_ERR_DISCONN
connection closed by remote site / host
uint16_t idx
0..RECEIVER_INFO::n_prg_out-1
double LLA[N_LLA]
A geographic position based on latitude, longitude, and altitude.
int mbgextio_get_gnss_sat_info(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, GNSS_SAT_INFO *p)
::TODO
#define MBG_DEFAULT_BAUDRATE_HS
The high speed baud rate used for the binary protocol.
(rw-) TZDL, time zone / daylight saving, only if GPS_MODEL_HAS_TZDL
#define _mbg_swab_ucap_net_glb_info(_p)
#define _mbg_swab_utc_parm(_p)
A structure combining all device feature information.
int mbgextio_get_net_stat_dns_srch_dom_stat_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_NET_NAME_IDX *p, uint16_t idx)
Read the current network DNS search domain in MBG_NET_NAME_IDX format.
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_req_ttm
Check if a device has MBG_XFEATURE_REQ_TTM.
int mbgextio_get_user_mngmnt_info(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_USER_MNGMNT_INFO *p)
Read the user management info in MBG_USER_MNGMNT_INFO format.
XDEVFEAT_CHK_SUPP_FNC xdevfeat_is_tcr
Check if a device is a time code receiver (IRIG or similar)
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_scu_stat
Check if the device supports the SCU_STAT structures.
#define _mbg_swab_xmr_holdover_intv(_p)
int mbgextio_get_ptp_v2_current_dataset(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_PTP_V2_CURRENT_DATASET *p)
Read the PTPv2 current dataset in MBG_PTP_V2_CURRENT_DATASET format.
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_lan_ip4
Check if a device supports the old LAN_IP4 API.
XDEVFEAT_CHK_SUPP_FNC xdevfeat_supp_tlv_diag_file
Check if a device supports creating / sending a diagnostics file via TLV.
Configuration settings of an IRIG input or output.
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_supp_tlv_fw_rollback
Check if a device supports a factory reset via TLV.
int mbgextio_set_ptp_uc_master_settings_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const PTP_UC_MASTER_SETTINGS *p, uint16_t idx)
Send PTP unicast master configuration settings for a PTP unicast slave mode device.
int mbgextio_open_serial_raw(const char *dev, MBG_MSG_CTL **ppmctl, uint32_t baud_rate, const char *framing)
Network interface route specific settings.
General info to be read from an LNE device.
#define _mbg_swab_event_value_idx(_p, _type)
int mbgextio_get_sw_rev(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, SW_REV *p)
Read the software revision.
uint8_t n_prg_out
number of programmable pulse outputs
(r–) GNSS_SAT_INFO, GLONASS-only satellite info (deprecated by GPS_GNSS_SAT_INFO_IDX) ...
(rw-) UTC, GPS UTC correction parameters
(rw-) LLA, current position in geographic coordinates, only if GPS_MODEL_HAS_POS_LLA ...
(r–) first/oldest MBG_EVT_LOG_ENTRY, only if GPS_HAS_EVT_LOG
Query MBG_NET_INTF_ADDR_INFO by its index.
Physical network interface link specific settings.
int mbgextio_get_ucap(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, TTM *p)
Read a user capture event in TTM format.
#define MBG_ERR_NOT_SUPP_BY_DEV
Command or feature not supported by device.
Current settings and general capabilities of an LED, plus index.
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_tlv_api
Check if a device supports the TLV API.
int mbgextio_xmt_cmd_u32(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, GPS_CMD cmd, uint32_t u32)
Transmit a message with a single ushort (uint32_t) parameter.
int mbgextio_set_ip4_settings(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const IP4_SETTINGS *p)
Save the current ipv4 settings IP4_SETTINGS format.
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_transactions
Check if a device has MBG_XFEATURE_TRANSACTIONS.
int mbgextio_get_xmr_instances(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, XMULTI_REF_INSTANCES *p)
TODO
int mbgextio_get_clk_res_info(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_CLK_RES_INFO *p)
Read clk_res_info from device.
int mbgextio_get_net_intf_addr_info_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_NET_INTF_ADDR_INFO_IDX *p, uint16_t idx)
Read MBG_NET_INTF_ADDR_INFO_IDX from the config with the given index.
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_ucap_net
Configuration settings for a single LNE port, plus index.
#define MBG_ERR_OVERFLOW
range or buffer overflow
The header checksum of a received message is invalid.
Configuration settings for a single LED, plus index.
(rw-) NTP_TRUSTED_KEY_INFO_IDX / NTP_TRUSTED_KEY_SETTINGS_IDX, only if NTP_GLB_INFO::max_trusted_keys...
char model_name[(16+1)]
ASCIIZ, name of receiver model.
#define _mbg_swab_xmulti_ref_settings_idx(_p)
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_time_scale
MBG_GNSS_MODE_SETTINGS gnss_mode_settings
int mbg_get_last_socket_error(const char *info)
Get and translate last error after socket function call.
BAUD_RATE mbg_baud_rates[N_MBG_BAUD_RATES]
#define MBG_ERR_XBP_CASC_LVL
too many XBP cascading levels
int mbgextio_get_ntp_peer_state_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, NTP_PEER_STATE_IDX *p, uint16_t idx)
Read the NTP peer state of current idx NTP_PEER_STATE format.
int mbgextio_set_ptp_v2_port_dataset_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const MBG_PTP_V2_PORT_DATASET *p, uint16_t idx)
Send PTPv2 port dataset with the appropriate index to a device in MBG_PTP_V2_PORT_DATASET format...
#define _mbg_swab_mbg_ref_offs(_p)
int conn_type
One of the MBG_CONN_TYPES.
#define _mbg_swab_ntp_misc_orphan_mode_settings(_p)
#define mbg_rc_is_error(_rc)
int mbgextio_set_snmp_v12_trap_settings_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const MBG_SNMP_V12_TRAP_SETTINGS *p, uint16_t idx)
Write SNMP v1 or v2 trap settings in MBG_SNMP_V12_TRAP_SETTINGS format.
int mbgextio_get_next_evt_log_entry(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_EVT_LOG_ENTRY *p)
Return the next entry from the on-board event log.
int mbgextio_get_tzdl(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, TZDL *p)
Read the local time conversion parameters in TZDL format.
int mbgextio_get_ant_info(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, ANT_INFO *p)
Read the GPS antenna info structure.
MBG_LED_SETTINGS settings
LED settings.
An XBP address specifier.
int mbgextio_socket_write_default(MBG_MSG_CTL *pmctl, const void *buf, size_t len)
Function, which can be used to write data to a standard LAN socket.
int mbgserio_close(MBGSERIO_DEV **pp_mdev)
Close a serial port specified by a MBGSERIO_DEV structure.
#define _mbg_swab_sw_rev(_p)
#define _mbg_swab_user_settings_idx(_p)
uint16_t idx
the priority level index (highest == 0), 0..XMULTI_REF_INSTANCES::n_xmr_settings-1 ...
(r–) MBG_IO_PORT_INFO_IDX, only supp. if MBG_XFEATURE_IO_PORTS is set in extended features and from ...
Specific output settings and limits, plus index.
#define _mbg_swab_fw_ufu_flash_cmd(_p)
int mbgextio_get_xmulti_ref_info_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, XMULTI_REF_INFO_IDX *p)
Read the multi ref info from a device.
const char * mbg_strerror(int mbg_errno)
Return an error string associated with the MBG_ERROR_CODES.
int mbgextio_get_debug_status(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_DEBUG_STATUS *p)
Read current debug status.
#define _mbg_swab_ntp_refclk_cfg_settings_idx(_p)
#define _mbg_swab_ptp_v1_default_dataset(_p)
(rw-) MBG_NET_INTF_ROUTE_INFO_IDX/MBG_NET_INTF_ROUTE_SETTINGS_IDX, only if MBG_NET_GLB_SUPP_STAGE_2_M...
A binary message has been received successfully.
#define MBGEXTIO_POLL_TIMEOUT_USB
int mbgextio_get_irig_rx_info(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, IRIG_INFO *p)
Read configuration info and supported features for the device's IRIG input.
MBG_PTP_V2_TIME_PROPERTIES_DATASET ptp_v2_time_properties_dataset
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_xmulti_ref
Check if a device supports the extended multi ref features including multi instances.
int mbgextio_get_all_pout_info(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, POUT_INFO_IDX *pii)
Read an array of current settings and capabilities of all programmable pulse outputs.
int mbgextio_set_net_intf_addr_settings_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const MBG_NET_INTF_ADDR_SETTINGS *p, uint16_t idx)
Send the network addr configuration in MBG_NET_INTF_ADDR_SETTINGS format.
(r–) MULTI_REF_INFO, only if GPS_HAS_MULTI_REF
#define _mbg_swab_snmp_v12_trap_settings_idx(_p)
Antenna status and error at reconnect information.
#define _mbg_swab_ntp_clnt_mode_settings(_p)
MBG_FW_UFU_FLASH_CMD fw_ufu_flash_cmd
(rw-) MBG_PTP_V1_PORT_DATASET_IDX, only supp. if PTP_CFG_MSK_HAS_V1_COMMON_DATASETS is set in PTP_CFG...
SW_REV sw_rev
software revision and ID
RECEIVER_INFO * mbgextio_get_receiver_info_addr(MBG_MSG_CTL *pmctl)
Retrieve address of the RECEIVER_INFO read from the device.
#define _mbg_swab_net_intf_link_settings_idx(_p)
#define _mbg_swab_ptp_v2_port_dataset_idx(_p)
uint16_t port_type
MBG_IO_PORT_TYPES
#define _mbg_swab_ptp_cfg_info(_p)
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_tainted_cfg
MBG_PTP_V1_PARENT_DATASET ptp_v1_parent_dataset
int mbgextio_get_io_port_limits(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_IO_PORT_LIMITS *p)
Read I/O port limits in MBG_IO_PORT_LIMITS format.
#define _mbg_swab_mbg_time_scale_info(_p)
#define _mbg_swab_ip_addr_idx(_p)
#define USB_VENDOR_MEINBERG
#define _mbg_swab_database_glb_info(_p)
MBG_IO_PORT_TYPE_INFO_IDX iop_type_info_idx
int mbgextio_get_net_intf_link_info_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_NET_INTF_LINK_INFO_IDX *p, uint16_t idx)
Read MBG_NET_INTF_LINK_INFO_IDX from the config with the given index.
int mbgserio_set_parms(MBGSERIO_DEV *mdev, uint32_t baud_rate, const char *framing)
const char * mbgextio_get_cmd_name(GPS_CMD cmd_code)
int mbgextio_get_ptp_v2_port_dataset_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_PTP_V2_PORT_DATASET_IDX *p, uint16_t idx)
Read the PTPv2 port dataset with the appropriate index in MBG_PTP_V2_PORT_DATASET_IDX format...
#define _mbg_swab_net_name_idx(_p)
to device: request acknowledge
(r–) MBG_IMS_FDM_STATE, only if MBG_IMS_STATE_FLAG_MSK_HAS_FDM is set in MBG_IMS_STATE::flags ...
#define _mbg_swab_monitoring_limits(_p)
#define _mbg_swab_net_intf_addr_info_idx(_p)
(rw-) MBG_NET_GLB_CFG_INFO/MBG_NET_GLB_CFG_SETTINGS, only if GPS_HAS_NET_CFG
#define MBG_ERR_NOT_SUPP_ON_OS
Function is not supported on this operating system.
the number of known framings
MBG_MSG_BUFF * mbgextio_get_xmt_buffer_addr(MBG_MSG_CTL *pmctl)
Retrieve address of the allocated transmit buffer.
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_gnss_mode
Check if a device supports GNSS mode feature All GNSS receivers support this feature by default...
XMR_HOLDOVER_INTV xmr_holdover_intv
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_push_msgs
Check if a device supports (un)registering for push messages.
#define _mbg_swab_mbg_lne_port_info_idx(_p)
int mbgextio_get_event_value_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, uint16_t eidx, uint8_t vtype, MBG_EVENT_VALUE_IDX *p, uint16_t vidx)
Read monitoring event status in MBG_EVENT_STATUS_IDX format.
Server settings info of an NTP device.
XBP_ADDR xbp_addr
XBP address of the transmitter or receiver.
General NTP symmetric key limits to be read from a device.
(rw-) MBG_PTP_V2_DEFAULT_DATASET, only supp. if PTP_CFG_MSK_HAS_V2_COMMON_DATASETS is set in PTP_CFG_...
#define _mbg_swab_receiver_info(_p)
int mbgextio_set_ptp_v1_parent_dataset(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const MBG_PTP_V1_PARENT_DATASET *p)
Send PTPv1 parent dataset to a device in MBG_PTP_V1_PARENT_DATASET format.
(-w-) Transmit UFU flash instructions MBG_FW_UFU_FLASH_CMD
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_reboot
Check if a device has MBG_XFEATURE_REBOOT.
MBG_SNMP_V3_TRAP_SETTINGS settings
#define _mbg_swab_net_intf_route_info_idx(_p)
(rw-) MBG_NET_INTF_LINK_INFO_IDX/MBG_NET_INTF_LINK_SETTINGS_IDX, only if MBG_NET_GLB_SUPP_STAGE_2_MAS...
MBG_SNMP_GLB_SETTINGS snmp_glb_settings
ENABLE_FLAGS enable_flags
Current settings and general capabilities of an LNE port, plus index.
#define _mbg_swab_ptp_uc_master_settings_idx(_p)
#define MBG_ERR_AUTH
Binary protocol failed authentication.
(rw-) MBG_LNE_PORT_SETTINGS_IDX, settings of a specific LED, only if MBG_XFEATURE_LNE_API ...
int mbgextio_get_ntp_misc_limits(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, NTP_MISC_LIMITS *p)
Read the NTP misc limits in NTP_MISC_LIMITS format.
static void handle_xbp_node(XBP_NODE_INFO *p_ni, long idx)
#define MBG_ERR_NBYTES
match the number of bytes expected by the device.
int MBG_TIME_MON_INST_INFO
int mbgextio_chk_user_perm(MBG_MSG_CTL *pmctl, uint16_t perm, uint32_t scope_mask)
Check user permission for one of the given scopes.
int mbgextio_get_database_info_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_DATABASE_INFO_IDX *p, uint8_t idx)
Read a database info with given index in MBG_DATABASE_INFO_IDX format.
#define _mbg_swab_ntp_misc_orphan_mode_info(_p)
(r–) PTP_STATE, current PTP status, only if GPS_HAS_PTP
int mbgextio_get_utc_parm(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, UTC *p)
Read a UTC parameter structure from a device.
(rw-) MBG_IMS_FDM_OUTPUT_SETTINGS_IDX, only if MBG_IMS_STATE_FLAG_MSK_HAS_FDM is set in MBG_IMS_STATE...
A structure used to identify a device type and supported features.
#define _mbg_swab_io_port_type_info_idx(_p, _recv)
int mbgextio_get_ptp_v2_time_properties_dataset(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_PTP_V2_TIME_PROPERTIES_DATASET *p)
Read the PTPv2 time properties dataset in MBG_PTP_V2_TIME_PROPERTIES_DATASET format.
Global configuration settings of an NTP device (client/server)
int mbgextio_get_io_port_status_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_IO_PORT_STATUS_IDX *p, uint8_t idx)
Read I/O port status in MBG_IO_PORT_STATUS_IDX format.
#define _mbg_swab_syslog_glb_info(_p)
connection via network socket
int mbgextio_set_ptp_v1_time_properties_dataset(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const MBG_PTP_V1_TIME_PROPERTIES_DATASET *p)
Send PTPv1 time properties dataset to a device in MBG_PTP_V1_TIME_PROPERTIES_DATASET format...
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_irig_rx
int mbgextio_get_snmp_v3_trap_info_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_SNMP_V3_TRAP_INFO_IDX *p, uint16_t idx)
Read SNMP v3 trap info in MBG_SNMP_V3_TRAP_INFO_IDX format.
#define _mbg_swab_mbg_raw_irig_data(_p)
uint16_t TZCODE
Type of variable to hold a TZ code.
int mbgextio_get_io_port_type_info_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_IO_PORT_TYPE_INFO_IDX *p, uint8_t port_idx, uint8_t port_type_idx)
Read I/O port type info in MBG_IO_PORT_TYPE_INFO_IDX format.
NTP trusted key settings, with index.
from device: error evaluating a command
(r–) MBG_OPT_INFO, only if GPS_HAS_OPT_SETTINGS
MBG_SNMP_V12_TRAP_SETTINGS settings
int mbgextio_get_enable_flags(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, ENABLE_FLAGS *p)
Read the enable flags controlling when output signals are enabled.
int mbgextio_get_lne_port_info_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_LNE_PORT_INFO_IDX *p, uint16_t idx)
Read a MBG_LNE_PORT_INFO_IDX parameter structure from a device.
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_enable_flags
#define MBG_ERR_DEV_NOT_SUPP
Device type not supported by driver.
(r–) XMR_EXT_SRC_INFO_IDX, only if XMRIF_MSK_EXT_SRC_INFO_SUPP
Output state of FDM device plus index.
Global current network settings and supported features.
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_ant_cable_length
Network interface address specific settings, flags and supported features.
(rw-) SYNTH, synthesizer settings, only if GPS_HAS_SYNTH
General NTP misc limits to be read from a device.
int mbg_get_last_error(const char *info)
Get and translate last error after non-socket function call.
uint32_t MBG_DEBUG_STATUS
A data type used to read the board's debug status.
#define _mbg_swab_debug_status(_p)
(r–) MBG_NET_NAME_IDX, DNS status, only if MBG_NET_GLB_CFG_INFO::n_supp_dns_srch_dom > 0 ...
#define _mbg_swab_ntp_symm_key_info_idx(_p)
int mbgextio_setup_xbp_node_list(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr)
Read the XBP_NODE_INFO for a specific node in XBP_NODE_INFO_IDX format //##+++++++++++++++++++++++++...
int mbgextio_get_ims_fdm_limits(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_IMS_FDM_LIMITS *p)
Read a MBG_IMS_FDM_LIMITS parameter structure from a device.
(r–) MBG_EVENT_VALUE_IDX, only supp. if MBG_EVENT_INFO::value_dict_entries > 0
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_io_ports
NTP symmetric key settings, with index.
Simple LAN interface information.
MBG_PTP_V1_DEFAULT_DATASET ptp_v1_default_dataset
(r–) IP4_SETTINGS, only if GPS_HAS_LAN_IP4
int mbgextio_get_ptp_v2_default_dataset(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_PTP_V2_DEFAULT_DATASET *p)
Read the PTPv2 default dataset in MBG_PTP_V2_DEFAULT_DATASET format.
int mbgextio_set_user_settings_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const MBG_USER_SETTINGS *p, uint16_t idx)
Write user settings in MBG_USER_SETTINGS_IDX format.
uint16_t idx
0..MBG_LNE_LIMITS::num_ports-1
MBGEXTIO_CHK_SUPP_FNC mbgextio_dev_has_gpio
(rw-) MBG_USER_MNGMNT_INFO / MBG_USER_MNGMNT_SETTINGS, only supp. if MBG_XFEATURE_USER_MNGMNT ...
XBP_ADDR addr
The address of the specific node.
int mbgextio_get_ntp_clnt_mode_info(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, NTP_CLNT_MODE_INFO *p)
Read the ntp global information NTP_CLNT_MODE_INFO format.
uint16_t idx
the priority level index (highest == 0), 0..XMULTI_REF_INSTANCES::n_xmr_settings-1 ...
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_ext_sys_info
Check if a device supports the MBG_EXT_SYS_INFO command.
int mbgextio_set_lne_port_settings_idx(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const MBG_LNE_PORT_SETTINGS *p, uint16_t idx)
Write a MBG_LNE_PORT_SETTINGS parameter structure to a device.
#define _mbg_swab_syslog_glb_settings(_p)
int mbgextio_get_all_str_type_info(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, STR_TYPE_INFO_IDX stii[])
Read an array of all supported string types.
int mbgextio_set_time(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const TTM *p)
Set the device's time by sending a TTM strucure.
(r–) MBG_NET_GLB_CFG_INFO, network status, only if MBG_NET_GLB_SUPP_STAGE_2_MASK is set in MBG_NET_G...
ulong mbgextio_get_dev_poll_timeout(const MBG_MSG_CTL *pmctl)
Get device poll timeout.
#define MBG_FORCE_CONN_HS_CMD_STR
switch to MBG_DEFAULT_BAUDRATE_HS
A structure controlling when output signals are enabled.
Current settings and general capabilities of a specific programmable pulse output.
int mbgextio_get_snmp_glb_info(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, MBG_SNMP_GLB_INFO *p)
Read the SNMP global info in MBG_SNMP_GLB_INFO format.
XDEVFEAT_CHK_SUPP_FNC xdevfeat_is_dcf
Check if a device is a DCF77 AM receiver.
#define _mbg_swab_scu_stat_settings(_p)
int mbgextio_set_hq_rx_settings(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const HAVEQUICK_SETTINGS *p)
Send new configuration settings for the device's HAVEQUICK input.
(rw-) TR_DISTANCE, dist. from transmitter [km], only if GPS_MODEL_IS_DCF_PZF
#define _mbg_swab_io_port_info_idx(_p, _recv)
#define _mbg_swab_port_info_idx(_p)
Configuration settings for a single LED.
int mbgextio_set_snmp_glb_settings(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, const MBG_SNMP_GLB_SETTINGS *p)
Send the SNMP global settings in MBG_SNMP_GLB_SETTINGS format.
Output settings of FDM device.
uint16_t idx
Index of the port dataset, 0..MBG_PTP_V2_DEFAULT_DATASET::number_ports - 1.
uint32_t supp_gnss_types
Bit masks of supported GNSS types, see MBG_GNSS_TYPE_MASKS.
#define _mbg_swab_mbg_ims_fdm_limits(_p)
long mbgextio_force_conn_serial_ftdi(int device_num)
Try to force a serial connection to a device via the FTDI API.
int mbgextio_rcv_msg(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, GPS_CMD cmd, void *buf, size_t buf_size)
Generic reception of a binary message.
int mbgextio_get_gps_stat_info(MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, STAT_INFO *p)
Read GPS status info.
#define MBG_ERR_SOCK_INIT
Socket interface not initialized, or failed to initialize.