Constructor
new NtripClient(eventEmitter, options)
Create a new NTRIP client
| Name | Type | Description |
|---|---|---|
eventEmitter | Object | Event emitter for communication |
options | Object | Configuration options |
- Source
Classes
Methods
(async) connect(config) → {Promise.<boolean>}
Connect to NTRIP caster using the configured method
| Name | Type | Description |
|---|---|---|
config | Object | Connection configuration |
- Source
Whether connection was successful
- Type:
- Promise.<boolean>
(async) connectDirect() → {Promise.<boolean>}
Connect directly to NTRIP caster
- Source
Whether connection was successful
- Type:
- Promise.<boolean>
(async) connectProxy() → {Promise.<boolean>}
Connect to NTRIP caster via HTTP proxy
- Source
Whether connection was successful
- Type:
- Promise.<boolean>
(async) connectWebSocket() → {Promise.<boolean>}
Connect to NTRIP caster using WebSocket to proxy
- Source
Whether connection was successful
- Type:
- Promise.<boolean>
createGgaSentence(position) → {string}
Create NMEA GGA sentence from position data
| Name | Type | Description |
|---|---|---|
position | Object | Position data |
- Source
GGA sentence
- Type:
- string
disconnect()
Disconnect from NTRIP caster
- Source
forwardRtcmToDevice(data)
Forward RTCM data to connected device
| Name | Type | Description |
|---|---|---|
data | ArrayBuffer | RTCM binary data to forward |
- Source
getConnectionInfo() → {Object}
Get connection status information
- Source
Connection status
- Type:
- Object
getRtcmStats() → {Object}
Get RTCM statistics
- Source
RTCM statistics
- Type:
- Object
handleDisconnect(event)
Handle disconnection (either manual or due to error)
| Name | Type | Description |
|---|---|---|
event | Object | Disconnection event info |
- Source
(async) handleRtcmData(data)
Handle binary RTCM data from WebSocket
| Name | Type | Description |
|---|---|---|
data | ArrayBuffer | | RTCM data |
- Source
handleSocketClose(event)
Handle WebSocket close event
| Name | Type | Description |
|---|---|---|
event | CloseEvent | WebSocket close event |
- Source
handleSocketError(event)
Handle WebSocket error event
| Name | Type | Description |
|---|---|---|
event | Event | WebSocket error event |
- Source
handleSocketMessage(event)
Handle WebSocket message (for WebSocket mode)
| Name | Type | Description |
|---|---|---|
event | MessageEvent | WebSocket message event |
- Source
isValidGga(sentence) → {boolean}
Validate if a GGA sentence is properly formatted
| Name | Type | Description |
|---|---|---|
sentence | string | GGA sentence to validate |
- Source
Whether the sentence is valid
- Type:
- boolean
isValidRtcmData(data) → {boolean}
Validate if the data is in RTCM3 format
| Name | Type | Description |
|---|---|---|
data | ArrayBuffer | Binary data to validate |
- Source
Whether the data appears to be valid RTCM3
- Type:
- boolean
(async) processRtcmQueue()
Process the queue of RTCM messages
- Source
(async) readStream()
Read and process the response stream from the NTRIP caster (for direct/proxy mode)
- Source
resetRtcmStats()
Reset RTCM statistics
- Source
scheduleReconnect()
Schedule a reconnection attempt
- Source
(async) sendGGA(gga) → {Promise.<boolean>}
Send NMEA GGA sentence to NTRIP caster
| Name | Type | Description |
|---|---|---|
gga | string | NMEA GGA sentence |
- Source
Whether message was sent successfully
- Type:
- Promise.<boolean>
(async) sendGGADirect(gga) → {Promise.<boolean>}
Send GGA directly to NTRIP caster
| Name | Type | Description |
|---|---|---|
gga | string | NMEA GGA sentence |
- Source
Whether message was sent successfully
- Type:
- Promise.<boolean>
(async) sendGGAProxy(gga) → {Promise.<boolean>}
Send GGA via proxy
| Name | Type | Description |
|---|---|---|
gga | string | NMEA GGA sentence |
- Source
Whether message was sent successfully
- Type:
- Promise.<boolean>
(async) sendGGAWebSocket(gga) → {Promise.<boolean>}
Send GGA via WebSocket
| Name | Type | Description |
|---|---|---|
gga | string | NMEA GGA sentence |
- Source
Whether message was sent successfully
- Type:
- Promise.<boolean>
setAutoReconnect(enabled, maxAttempts)
Enable/disable auto-reconnect
| Name | Type | Default | Description |
|---|---|---|---|
enabled | boolean | Whether auto-reconnect is enabled | |
maxAttempts | number | 5 | Maximum reconnection attempts |
- Source
setDeviceManager(deviceManager)
Set the device manager for sending corrections
| Name | Type | Description |
|---|---|---|
deviceManager | Object | ConnectionManager or BluetoothManager |
- Source
setGgaUpdateInterval(seconds)
Set the GGA update interval
| Name | Type | Description |
|---|---|---|
seconds | number | Update interval in seconds |
- Source
startGgaUpdates()
Start periodically sending GGA updates to the NTRIP caster
- Source
stopGgaUpdates()
Stop sending GGA updates
- Source
updateCorrectionAge()
Update correction age based on last message time
- Source
updatePosition(position)
Update the device with the latest position
| Name | Type | Description |
|---|---|---|
position | Object | Position data |
- Source