Class: OpenC3::CmdTlmWebSocketApi
- Inherits:
-
WebSocketApi
- Object
- WebSocketApi
- OpenC3::CmdTlmWebSocketApi
- Defined in:
- lib/openc3/script/web_socket_api.rb
Overview
Base class for cmd-tlm-api websockets - Do not use directly
Direct Known Subclasses
AutonomicEventsWebSocketApi, CalendarEventsWebSocketApi, ConfigEventsWebSocketApi, LimitsEventsWebSocketApi, MessagesWebSocketApi, QueueEventsWebSocketApi, StreamingWebSocketApi, SystemEventsWebSocketApi, TimelineEventsWebSocketApi
Constant Summary
Constants inherited from WebSocketApi
WebSocketApi::DEFAULT_OPTIONS, WebSocketApi::USER_AGENT
Instance Method Summary collapse
- #generate_url ⇒ Object
-
#initialize(url: nil, **options) ⇒ CmdTlmWebSocketApi
constructor
A new instance of CmdTlmWebSocketApi.
Methods inherited from WebSocketApi
cable_url, #check_protocol_frame, #connect, #connected?, #disconnect, #generate_auth, #parse_message, #read, #read_message, #subscribe, #unsubscribe, #wait_for_subscribed, #write, #write_action, #write_command
Constructor Details
#initialize(url: nil, **options) ⇒ CmdTlmWebSocketApi
Returns a new instance of CmdTlmWebSocketApi.
275 276 277 278 |
# File 'lib/openc3/script/web_socket_api.rb', line 275 def initialize(url: nil, **) url = generate_url() unless url super(url: url, **) end |
Instance Method Details
#generate_url ⇒ Object
280 281 282 283 284 285 286 287 |
# File 'lib/openc3/script/web_socket_api.rb', line 280 def generate_url return WebSocketApi.cable_url( env_prefix: 'OPENC3_API', default_hostname: 'openc3-cosmos-cmd-tlm-api', default_port: '3901', path: '/openc3-api/cable' ) end |