Skip to content

Commit a38111d

Browse files
committed
various fixes
1 parent 6c09ca6 commit a38111d

File tree

8 files changed

+19
-24
lines changed

8 files changed

+19
-24
lines changed

Diff for: packages/control-hub/src/internal/ControlHub.ts

+10-10
Original file line numberDiff line numberDiff line change
@@ -480,48 +480,48 @@ export class ControlHubInternal implements ControlHub {
480480

481481
async readI2CMultipleBytes(
482482
i2cChannel: number,
483-
slaveAddress: number,
483+
targetAddress: number,
484484
numBytesToRead: number,
485485
): Promise<number[]> {
486486
return await this.embedded.readI2CMultipleBytes(
487487
i2cChannel,
488-
slaveAddress,
488+
targetAddress,
489489
numBytesToRead,
490490
);
491491
}
492492

493-
async readI2CSingleByte(i2cChannel: number, slaveAddress: number): Promise<number> {
494-
return await this.embedded.readI2CSingleByte(i2cChannel, slaveAddress);
493+
async readI2CSingleByte(i2cChannel: number, targetAddress: number): Promise<number> {
494+
return await this.embedded.readI2CSingleByte(i2cChannel, targetAddress);
495495
}
496496

497497
async writeI2CMultipleBytes(
498498
i2cChannel: number,
499-
slaveAddress: number,
499+
targetAddress: number,
500500
bytes: number[],
501501
): Promise<void> {
502-
return await this.embedded.writeI2CMultipleBytes(i2cChannel, slaveAddress, bytes);
502+
return await this.embedded.writeI2CMultipleBytes(i2cChannel, targetAddress, bytes);
503503
}
504504

505505
async writeI2CReadMultipleBytes(
506506
i2cChannel: number,
507-
slaveAddress: number,
507+
targetAddress: number,
508508
numBytesToRead: number,
509509
startAddress: number,
510510
): Promise<void> {
511511
return await this.embedded.writeI2CReadMultipleBytes(
512512
i2cChannel,
513-
slaveAddress,
513+
targetAddress,
514514
numBytesToRead,
515515
startAddress,
516516
);
517517
}
518518

519519
async writeI2CSingleByte(
520520
i2cChannel: number,
521-
slaveAddress: number,
521+
targetAddress: number,
522522
byte: number,
523523
): Promise<void> {
524-
return await this.embedded.writeI2CSingleByte(i2cChannel, slaveAddress, byte);
524+
return await this.embedded.writeI2CSingleByte(i2cChannel, targetAddress, byte);
525525
}
526526

527527
async readVersion(): Promise<Version> {

Diff for: packages/control-hub/src/internal/ControlHubConnectedExpansionHub.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -603,9 +603,9 @@ export class ControlHubConnectedExpansionHub implements ParentExpansionHub {
603603
}
604604

605605
async getDigitalDirection(dioPin: number): Promise<DigitalChannelDirection> {
606-
let isOutput = await this.sendCommand("getDigitalDirection", {
606+
let isOutput = await this.sendCommand("isDigitalOutput", {
607607
hId: this.id,
608-
channel: dioPin,
608+
c: dioPin,
609609
});
610610

611611
return isOutput ? DigitalChannelDirection.Output : DigitalChannelDirection.Input;

Diff for: packages/core/src/ExpansionHub.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import { VerbosityLevel } from "./VerbosityLevel.js";
99
import { Version } from "./Version.js";
1010
import { DigitalChannelDirection } from "./DigitalChannelDirection.js";
1111
import { I2CSpeedCode } from "./I2CSpeedCode.js";
12-
import { I2CWriteStatus } from "./I2CWriteStatus.js";
13-
import { I2CReadStatus } from "./I2CReadStatus.js";
1412
import { MotorMode } from "./MotorMode.js";
1513
import { PidCoefficients } from "./PidCoefficients.js";
1614
import { PidfCoefficients } from "./PidfCoefficients.js";
@@ -30,8 +28,6 @@ export interface ExpansionHub extends RevHub {
3028
* it has been closed.
3129
*/
3230
close(): void;
33-
sendWriteCommand(packetTypeID: number, payload: number[]): Promise<number[]>;
34-
sendReadCommand(packetTypeID: number, payload: number[]): Promise<number[]>;
3531
getModuleStatus(clearStatusAfterResponse: boolean): Promise<ModuleStatus>;
3632
sendKeepAlive(): Promise<void>;
3733
sendFailSafe(): Promise<void>;
@@ -239,7 +235,7 @@ export interface ExpansionHub extends RevHub {
239235
*/
240236
readI2CRegister(
241237
i2cChannel: number,
242-
slaveAddress: number,
238+
targetAddress: number,
243239
numBytesToRead: number,
244240
register: number,
245241
): Promise<number[]>;

Diff for: packages/expansion-hub/src/internal/ExpansionHub.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
DigitalChannelDirection,
77
DigitalState,
88
ExpansionHub, GeneralSerialError,
9+
I2cOperationInProgressError,
910
I2CReadStatus,
1011
I2CSpeedCode,
1112
I2CWriteStatus,
@@ -15,7 +16,6 @@ import {
1516
MotorMode,
1617
NackCode, nackCodeToError, NoExpansionHubWithAddressError,
1718
ParameterOutOfRangeError,
18-
I2cOperationInProgressError,
1919
ParentRevHub,
2020
PidCoefficients,
2121
PidfCoefficients,

Diff for: packages/sample/src/command/distance.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { ExpansionHub } from "@rev-robotics/rev-hub-core";
21
import { DistanceSensor } from "@rev-robotics/distance-sensor";
2+
import { ExpansionHub } from "@rev-robotics/rev-hub-core";
33

44
export async function distance(
55
hub: ExpansionHub,

Diff for: packages/sample/src/command/list.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { openConnectedExpansionHubs } from "@rev-robotics/expansion-hub";
22
import { controlHubHierarchyToString } from "../HubStringify.js";
3-
import {ExpansionHub} from "@rev-robotics/rev-hub-core";
4-
import {openUsbControlHubsAndChildren} from "../open-control-hub.js";
3+
import { ExpansionHub } from "@rev-robotics/rev-hub-core";
4+
import { openUsbControlHubsAndChildren } from "../open-control-hub.js";
55

66
export async function list() {
77
let usbControlHubs = await openUsbControlHubsAndChildren();

Diff for: packages/sample/src/command/log.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { DebugGroup, VerbosityLevel } from "@rev-robotics/rhsplib";
2-
import { ExpansionHub } from "@rev-robotics/rev-hub-core";
1+
import { ExpansionHub, DebugGroup, VerbosityLevel } from "@rev-robotics/rev-hub-core";
32

43
export async function injectLog(hub: ExpansionHub, hint: string) {
54
await hub.injectDataLogHint(hint);

Diff for: packages/sample/src/command/servo.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {ExpansionHub} from "@rev-robotics/rev-hub-core";
1+
import { ExpansionHub } from "@rev-robotics/rev-hub-core";
22

33
export async function runServo(hub: ExpansionHub, channel: number, pulseWidth: number, framePeriod: number) {
44
await hub.setServoConfiguration(channel, framePeriod);

0 commit comments

Comments
 (0)