...
This commit is contained in:
6
App.tsx
6
App.tsx
@@ -180,9 +180,9 @@ const App: React.FC = () => {
|
||||
}, [addLog]);
|
||||
|
||||
// Tag Transmission Logic
|
||||
const sendTag = useCallback((tagId: string) => {
|
||||
const sendTag = useCallback((tagId: string | number) => {
|
||||
if (agvSerialRef.current) {
|
||||
const paddedId = tagId.padStart(6, '0').slice(-6);
|
||||
const paddedId = String(tagId).padStart(6, '0').slice(-6);
|
||||
const encoder = new TextEncoder();
|
||||
const cmdBytes = encoder.encode("TAG");
|
||||
const valBytes = encoder.encode(paddedId);
|
||||
@@ -704,7 +704,7 @@ const App: React.FC = () => {
|
||||
return;
|
||||
}
|
||||
|
||||
const id = 1; // Default AGV ID
|
||||
const id = 0; // Default ACS ID = 0
|
||||
const len = 1 + 1 + payload.length; // ID + CMD + DATA
|
||||
const buffer = [0x02, len, id, cmd, ...payload];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user