-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new websocket messages for managing station state #62
Conversation
…kAudio into neilenns/kSetStationStatus
…kAudio into neilenns/kSetStationStatus
…kAudio into neilenns/kSetStationStatus
backend/src/main.cpp
Outdated
|
||
return Napi::Boolean::New(info.Env(), true); | ||
auto result = RadioHelper::SetRadioState(MainThreadShared::mApiServer.get(), newState); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather you you don't access the raw ptr behind the shared_ptr, if it's currently a unique_ptr change it to a shared_ptr and pass it by reference, that's the whole point of smart pointers
backend/src/main.cpp
Outdated
newState.headset = false; | ||
newState.xca = false; | ||
|
||
RadioHelper::SetRadioState(MainThreadShared::mApiServer.get(), newState); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, no raw pointers please
backend/src/main.cpp
Outdated
|
||
return Napi::Boolean::New(info.Env(), true); | ||
auto result = RadioHelper::SetRadioState(MainThreadShared::mApiServer.get(), newState); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here for raw pointers
Fixes #53
kSetStationState
,kGetStationState
, andkGetStationStates
kStationStateUpdate
,kStationStates
, andkVoiceConnectedState
RadioHelper
class with a method to manage setting radio statesmain.cpp
and usesRadioHelper
insteadstation-state-update
kSetStationState
messagesstation-state-update
to refresh the state of a radio based on the values receivedSee comments on the PR for additional info.