diff --git a/src/actions.ts b/src/actions.ts index bdfb00c3..085b38a8 100644 --- a/src/actions.ts +++ b/src/actions.ts @@ -4,12 +4,12 @@ import { Dispatch as ReduxDispatch } from 'redux'; import { AppAction } from './app/actions'; import { BleDIServiceAction } from './ble-device-info-service/actions'; +import { BleUartAction } from './ble-nordic-uart-service/actions'; import { BlePybricksServiceAction, BlePybricksServiceCommandAction, BlePybricksServiceEventAction, } from './ble-pybricks-service/actions'; -import { BleUartAction } from './ble-uart/actions'; import { BLEAction, BLEConnectAction } from './ble/actions'; import { EditorAction } from './editor/actions'; import { FlashFirmwareAction } from './firmware/actions'; diff --git a/src/ble-uart/actions.ts b/src/ble-nordic-uart-service/actions.ts similarity index 95% rename from src/ble-uart/actions.ts rename to src/ble-nordic-uart-service/actions.ts index 71e02f41..6756aa61 100644 --- a/src/ble-uart/actions.ts +++ b/src/ble-nordic-uart-service/actions.ts @@ -1,6 +1,7 @@ // SPDX-License-Identifier: MIT // Copyright (c) 2020-2021 The Pybricks Authors -// actions/ble-uart.ts: Actions for Bluetooth Low Energy nRF UART service +// +// Actions for Bluetooth Low Energy Nordic UART service import { Action } from 'redux'; diff --git a/src/ble-uart/protocol.ts b/src/ble-nordic-uart-service/protocol.ts similarity index 100% rename from src/ble-uart/protocol.ts rename to src/ble-nordic-uart-service/protocol.ts diff --git a/src/ble/sagas.ts b/src/ble/sagas.ts index 5ba1db13..d591a798 100644 --- a/src/ble/sagas.ts +++ b/src/ble/sagas.ts @@ -27,6 +27,18 @@ import { pnpIdUUID, softwareRevisionStringUUID, } from '../ble-device-info-service/protocol'; +import { + BleUartActionType, + BleUartWriteAction, + didFailToWrite as didFailToWriteUart, + didNotify as didNotifyUart, + didWrite as didWriteUart, +} from '../ble-nordic-uart-service/actions'; +import { + RxCharUUID as uartRxCharUUID, + ServiceUUID as uartServiceUUID, + TxCharUUID as uartTxCharUUID, +} from '../ble-nordic-uart-service/protocol'; import { BlePybricksServiceActionType, didFailToWriteCommand, @@ -37,18 +49,6 @@ import { ControlCharacteristicUUID as pybricksCommandCharacteristicUUID, ServiceUUID as pybricksServiceUUID, } from '../ble-pybricks-service/protocol'; -import { - BleUartActionType, - BleUartWriteAction, - didFailToWrite as didFailToWriteUart, - didNotify as didNotifyUart, - didWrite as didWriteUart, -} from '../ble-uart/actions'; -import { - RxCharUUID as uartRxCharUUID, - ServiceUUID as uartServiceUUID, - TxCharUUID as uartTxCharUUID, -} from '../ble-uart/protocol'; import { RootState } from '../reducers'; import { ensureError } from '../utils'; import { diff --git a/src/error-log/sagas.test.ts b/src/error-log/sagas.test.ts index d980bb03..664e0991 100644 --- a/src/error-log/sagas.test.ts +++ b/src/error-log/sagas.test.ts @@ -2,8 +2,8 @@ // Copyright (c) 2020 The Pybricks Authors import { AsyncSaga } from '../../test'; +import { didFailToWrite } from '../ble-nordic-uart-service/actions'; import { eventProtocolError } from '../ble-pybricks-service/actions'; -import { didFailToWrite } from '../ble-uart/actions'; import { BleDeviceFailToConnectReasonType, didFailToConnect as bleDidFailToConnect, diff --git a/src/error-log/sagas.ts b/src/error-log/sagas.ts index c4e40ea3..b918f7db 100644 --- a/src/error-log/sagas.ts +++ b/src/error-log/sagas.ts @@ -2,11 +2,14 @@ // Copyright (c) 2020-2021 The Pybricks Authors import { takeEvery } from 'typed-redux-saga/macro'; +import { + BleUartActionType, + BleUartDidFailToWriteAction, +} from '../ble-nordic-uart-service/actions'; import { BlePybricksServiceEventActionType, BlePybricksServiceEventProtocolErrorAction, } from '../ble-pybricks-service/actions'; -import { BleUartActionType, BleUartDidFailToWriteAction } from '../ble-uart/actions'; import { BleDeviceActionType, BleDeviceDidFailToConnectAction, diff --git a/src/hub/sagas.test.ts b/src/hub/sagas.test.ts index 0528b4f2..1e2b5ff9 100644 --- a/src/hub/sagas.test.ts +++ b/src/hub/sagas.test.ts @@ -4,12 +4,16 @@ import { mock } from 'jest-mock-extended'; import { monaco } from 'react-monaco-editor'; import { AsyncSaga } from '../../test'; +import { + BleUartActionType, + BleUartWriteAction, + didWrite, +} from '../ble-nordic-uart-service/actions'; import { BlePybricksServiceCommandActionType, BlePybricksServiceCommandSendStopUserProgram, didSendCommand, } from '../ble-pybricks-service/actions'; -import { BleUartActionType, BleUartWriteAction, didWrite } from '../ble-uart/actions'; import { MpyActionType, didCompile } from '../mpy/actions'; import { createCountFunc } from '../utils/iter'; import { diff --git a/src/hub/sagas.ts b/src/hub/sagas.ts index f1fdae24..ac855a52 100644 --- a/src/hub/sagas.ts +++ b/src/hub/sagas.ts @@ -13,19 +13,19 @@ import { takeEvery, } from 'typed-redux-saga/macro'; import { Action } from '../actions'; +import { + BleUartActionType, + BleUartDidFailToWriteAction, + BleUartDidWriteAction, + write, +} from '../ble-nordic-uart-service/actions'; +import { SafeTxCharLength } from '../ble-nordic-uart-service/protocol'; import { BlePybricksServiceCommandActionType, BlePybricksServiceCommandDidFailToSendAction, BlePybricksServiceCommandDidSendAction, sendStopUserProgramCommand, } from '../ble-pybricks-service/actions'; -import { - BleUartActionType, - BleUartDidFailToWriteAction, - BleUartDidWriteAction, - write, -} from '../ble-uart/actions'; -import { SafeTxCharLength } from '../ble-uart/protocol'; import { BleDeviceActionType } from '../ble/actions'; import { MpyActionType, diff --git a/src/terminal/sagas.test.ts b/src/terminal/sagas.test.ts index 9ef0953c..495eea54 100644 --- a/src/terminal/sagas.test.ts +++ b/src/terminal/sagas.test.ts @@ -9,7 +9,7 @@ import { didFailToWrite, didNotify, didWrite, -} from '../ble-uart/actions'; +} from '../ble-nordic-uart-service/actions'; import { HubChecksumMessageAction, HubMessageActionType } from '../hub/actions'; import { HubRuntimeState } from '../hub/reducers'; import { createCountFunc } from '../utils/iter'; diff --git a/src/terminal/sagas.ts b/src/terminal/sagas.ts index c3722ffc..bd5f021f 100644 --- a/src/terminal/sagas.ts +++ b/src/terminal/sagas.ts @@ -13,8 +13,12 @@ import { takeEvery, } from 'typed-redux-saga/macro'; import { Action } from '../actions'; -import { BleUartActionType, BleUartDidNotifyAction, write } from '../ble-uart/actions'; -import { SafeTxCharLength } from '../ble-uart/protocol'; +import { + BleUartActionType, + BleUartDidNotifyAction, + write, +} from '../ble-nordic-uart-service/actions'; +import { SafeTxCharLength } from '../ble-nordic-uart-service/protocol'; import { checksum } from '../hub/actions'; import { HubRuntimeState } from '../hub/reducers'; import { RootState } from '../reducers';