You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
532 B
20 lines
532 B
// @flow
|
|
|
|
import { createCommand, Command } from 'helpers/ipc'
|
|
import { fromPromise } from 'rxjs/observable/fromPromise'
|
|
import { withDevice } from 'helpers/deviceAccess'
|
|
|
|
import getDeviceInfo from 'helpers/devices/getDeviceInfo'
|
|
import type { DeviceInfo } from 'helpers/types'
|
|
|
|
type Input = {
|
|
devicePath: string,
|
|
}
|
|
|
|
type Result = DeviceInfo
|
|
|
|
const cmd: Command<Input, Result> = createCommand('getDeviceInfo', ({ devicePath }) =>
|
|
fromPromise(withDevice(devicePath)(transport => getDeviceInfo(transport))),
|
|
)
|
|
|
|
export default cmd
|
|
|