---
name: "NJB_Ping"
section: "3"
platform: "linux"
package: "libnjb1-doc"
version: "1.1-2"
release: "Debian 4.0 (Etch)"
platforms: ["linux"]
url: "https://new.carta.tech/NJB_Ping"
---

# NJB\_Ping(3)

ping an open NJB device

## NAME

NJB\_Ping - ping an open NJB device

## LIBRARY

libnjb

## SYNOPSIS

\#include \<libnjb.h\>

extern int njb\_error

njbid\_t \*NJB\_Ping (njb\_t \*njb)

## DESCRIPTION

The  **NJB\_ping** function will ping the NJB device, requesting an njbid\_t which returns a structure of this layout:

typedef struct {\
         unsigned char id\[16\];\
         u\_int8\_t fwMajor;\
         u\_int8\_t fwMinor;\
         u\_int8\_t fwRel;\
         char productName\[33\];\
         u\_int8\_t power; } njbid\_t;

When a njbid\_t has been obtained using NJB\_Ping() it must be freed using free().

- id

  A string representing the Jukebox unique ID. This may be used for filenames storing device-specific file caches and similar things associated with a unique device.

- fwMajor

  8-bit integer representing the major revision of the firmware.

- fwMinor

  8-bit integer representing the minor revision of the firmware.

- fwRel

  8-bit integer representing the release revision of the firmware. This parameter is only supplied with newer jukeboxes and is 0 for old jukeboxes.

- productName

  A string giving the unique product name given this product, such as "Nomad Jukebox ZEN" and similar strings.

- power

  An integer indicating if the device is currently connected to a power outlet. This is primarily used for checking that the power is connected before flashing a firmware upgrade.

## SEE ALSO

[NJB\_Discover(3)](/NJB_Discover/3.md), [NJB\_Open(3)](/NJB_Open/3.md)
