Skip to content

Commit

Permalink
fix: Configuration Command
Browse files Browse the repository at this point in the history
  • Loading branch information
Balte de Wit committed Sep 21, 2019
1 parent 58b1984 commit ab5bf19
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions src/commands/configuration.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
import { SynchronousCode } from '../codes'
import { ResponseMessage, NamedMessage } from '../message'
import { AbstractCommand } from './abstractCommand'
import { AbstractCommand, AbstractCommandNoResponse } from './abstractCommand'

export interface ConfigurationCommandResponse {
videoInput: string
audioInput: string
fileFormat: string
}

export class ConfigurationCommand extends AbstractCommand {
export class ConfigurationGetCommand extends AbstractCommand {
expectedResponseCode = SynchronousCode.DeviceInfo

videoInput?: string
audioInput?: string
fileFormat?: string

deserialize (msg: ResponseMessage) {
const res: ConfigurationCommandResponse = {
videoInput: msg.params['video input'],
Expand All @@ -24,6 +20,21 @@ export class ConfigurationCommand extends AbstractCommand {
return res
}

serialize () {
const res: NamedMessage = {
name: 'configuration',
params: {}
}

return res
}
}

export class ConfigurationCommand extends AbstractCommandNoResponse {
videoInput?: string
audioInput?: string
fileFormat?: string

constructor (videoInput?: string, audioInput?: string, fileFormat?: string) {
super()

Expand All @@ -34,7 +45,7 @@ export class ConfigurationCommand extends AbstractCommand {

serialize () {
const res: NamedMessage = {
name: 'jog',
name: 'configuration',
params: {}
}

Expand Down

0 comments on commit ab5bf19

Please sign in to comment.