72
72
memFree : Cardinal;
73
73
pressed : boolean;
74
74
btncount : byte;
75
- Msg : NXTMessage ;
75
+ Msg : PBRMessage ;
76
76
77
77
78
78
@@ -184,12 +184,12 @@ begin
184
184
Writeln(' -btreset : reset the NXT bluetooth to factory settings (usb only)' );
185
185
Writeln(' -defrag : defragment the NXT filesystem' );
186
186
{
187
- SetNXTOutputState
188
- SetNXTInputMode
189
- NXTPollCommandLen
190
- NXTPollCommand
191
- NXTWriteIOMap
192
- NXTReadIOMap
187
+ DCSetOutputState
188
+ DCSetInputMode
189
+ SCPollCommandLen
190
+ SCPollCommand
191
+ SCWriteIOMap
192
+ SCReadIOMap
193
193
NXTLowSpeed[port : byte]
194
194
}
195
195
Writeln(' General:' );
@@ -308,7 +308,7 @@ begin
308
308
end ;
309
309
if ParamSwitch(' -clear' ) then
310
310
if IsNXT then
311
- BrickComm.NXTDeleteUserFlash (True)
311
+ BrickComm.SCDeleteUserFlash (True)
312
312
else
313
313
BrickComm.ClearMemory;
314
314
if ParamSwitch(' -near' ) and NotNXT then
@@ -326,7 +326,7 @@ begin
326
326
if ParamSwitch(' -run' ) then begin
327
327
// run with filename for NXT
328
328
if IsNXT then
329
- BrickComm.NXTStartProgram (ParamValue(' -run' ))
329
+ BrickComm.DCStartProgram (ParamValue(' -run' ))
330
330
else
331
331
BrickComm.StartTask(ParamIntValue(' -run' , 0 ));
332
332
end ;
@@ -335,7 +335,7 @@ begin
335
335
if ParamSwitch(' -msg' ) then
336
336
begin
337
337
if IsNXT then
338
- BrickComm.NXTMessageWrite (ParamIntValue(' /Inbox' , 0 ), ParamValue(' -msg' ))
338
+ BrickComm.DCMessageWrite (ParamIntValue(' /Inbox' , 0 ), ParamValue(' -msg' ))
339
339
else
340
340
BrickComm.SendMessage(ParamIntValue(' -msg' , 0 ));
341
341
end ;
@@ -352,7 +352,7 @@ begin
352
352
if IsNXT then
353
353
begin
354
354
port := ParamIntValue(' -input' , 0 );
355
- if BrickComm.GetNXTInputValues (port, valid,
355
+ if BrickComm.DCGetInputValues (port, valid,
356
356
calibrated, stype, smode, raw, normalized, scaled, calvalue) then
357
357
begin
358
358
Writeln(Format(' Port: %d' #13 #10 +
@@ -379,7 +379,7 @@ begin
379
379
if IsNXT then
380
380
begin
381
381
port := ParamIntValue(' -output' , 0 );
382
- if BrickComm.GetNXTOutputState (port, power, mode,
382
+ if BrickComm.DCGetOutputState (port, power, mode,
383
383
regmode, turnratio, runstate, tacholimit, tachocount, blocktachocount, rotationcount) then
384
384
begin
385
385
Writeln(Format(' Port: %d' #13 #10 +
@@ -419,33 +419,33 @@ begin
419
419
BrickComm.PlayTone(ParamIntValue(' -playtone' , 440 ), ParamIntValue(' /Duration' , 500 ));
420
420
// NXT actions
421
421
if ParamSwitch(' -stop' ) and IsNXT then
422
- BrickComm.NXTStopProgram ;
422
+ BrickComm.DCStopProgram ;
423
423
if ParamSwitch(' -playfile' ) and IsNXT then
424
- BrickComm.NXTPlaySoundFile (ParamValue(' -playfile' ), ParamSwitch(' /L' ));
424
+ BrickComm.DCPlaySoundFile (ParamValue(' -playfile' ), ParamSwitch(' /L' ));
425
425
if ParamSwitch(' -keepalive' ) and IsNXT then
426
426
begin
427
- if BrickComm.NXTKeepAlive (cvalue) then
427
+ if BrickComm.DCKeepAlive (cvalue) then
428
428
OutputValue(cvalue);
429
429
end ;
430
430
if ParamSwitch(' -resetoutputposition' ) and IsNXT then
431
- BrickComm.NXTResetOutputPosition (ParamIntValue(' -resetoutputposition' , 0 ), ParamSwitch(' /Relative' ));
431
+ BrickComm.DCResetOutputPosition (ParamIntValue(' -resetoutputposition' , 0 ), ParamSwitch(' /Relative' ));
432
432
if ParamSwitch(' -resetinputsv' ) and IsNXT then
433
- BrickComm.NXTResetInputScaledValue (ParamIntValue(' -resetinputsv' , 0 ));
433
+ BrickComm.DCResetInputScaledValue (ParamIntValue(' -resetinputsv' , 0 ));
434
434
if ParamSwitch(' -upload' ) and IsNXT then
435
- BrickComm.NXTUploadFile (ParamValue(' -upload' ));
435
+ BrickComm.UploadFile (ParamValue(' -upload' ));
436
436
if ParamSwitch(' -download' ) and IsNXT then
437
437
begin
438
438
pattern := ParamValue(' -download' );
439
- BrickComm.NXTDownloadFile (pattern, NameToNXTFileType (pattern));
439
+ BrickComm.DownloadFile (pattern, NXTNameToPBRFileType (pattern));
440
440
end ;
441
441
if ParamSwitch(' -delete' ) and IsNXT then
442
442
begin
443
443
pattern := ParamValue(' -delete' );
444
- BrickComm.NXTDeleteFile (pattern, True);
444
+ BrickComm.SCDeleteFile (pattern, True);
445
445
end ;
446
446
if ParamSwitch(' -defrag' ) then
447
447
begin
448
- if not BrickComm.NXTDefragmentFlash then
448
+ if not BrickComm.SCDefragmentFlash then
449
449
WriteLn(' Defragmentation failed' );
450
450
end ;
451
451
if ParamSwitch(' -listfiles' ) and IsNXT then
@@ -454,7 +454,7 @@ begin
454
454
if pattern = ' ' then
455
455
pattern := ' *.*' ;
456
456
SL.Clear;
457
- BrickComm.NXTListFiles (pattern, SL);
457
+ BrickComm.ListFiles (pattern, SL);
458
458
for i := 0 to SL.Count - 1 do
459
459
WriteLn(SL[i]);
460
460
end ;
@@ -464,32 +464,32 @@ begin
464
464
if pattern = ' ' then
465
465
pattern := ' *.*' ;
466
466
SL.Clear;
467
- BrickComm.NXTListModules (pattern, SL);
467
+ BrickComm.ListModules (pattern, SL);
468
468
for i := 0 to SL.Count - 1 do
469
469
WriteLn(SL[i]);
470
470
end ;
471
471
if ParamSwitch(' -runningprogram' ) and IsNXT then
472
472
begin
473
- if BrickComm.NXTGetCurrentProgramName (pattern) then
473
+ if BrickComm.DCGetCurrentProgramName (pattern) then
474
474
Writeln(pattern);
475
475
end ;
476
476
if ParamSwitch(' -setname' ) and IsNXT then
477
- BrickComm.NXTSetBrickName (ParamValue(' -setname' ), True);
477
+ BrickComm.SCSetBrickName (ParamValue(' -setname' ), True);
478
478
if ParamSwitch(' -boot' ) and IsNXT then
479
- BrickComm.NXTBootCommand (True);
479
+ BrickComm.SCBootCommand (True);
480
480
if ParamSwitch(' -btreset' ) and IsNXT then
481
- BrickComm.NXTBTFactoryReset (True);
481
+ BrickComm.SCBTFactoryReset (True);
482
482
if ParamSwitch(' -versions' ) and IsNXT then
483
483
begin
484
- if BrickComm.NXTGetVersions (pmin, pmaj, fmin, fmaj) then
484
+ if BrickComm.SCGetVersions (pmin, pmaj, fmin, fmaj) then
485
485
begin
486
486
Writeln(Format(' Protocol version = %d.%d' , [pmaj, pmin]));
487
487
Writeln(Format(' Firmware version = %d.%d' , [fmaj, fmin]));
488
488
end ;
489
489
end ;
490
490
if ParamSwitch(' -deviceinfo' ) and IsNXT then
491
491
begin
492
- if BrickComm.NXTGetDeviceInfo (pattern, btaddr, btsig, memFree) then
492
+ if BrickComm.SCGetDeviceInfo (pattern, btaddr, btsig, memFree) then
493
493
begin
494
494
Writeln(Format(' Brick name = %s' , [pattern]));
495
495
Writeln(Format(' Bluetooth Address = %s' , [btaddr]));
@@ -499,35 +499,35 @@ begin
499
499
end ;
500
500
if ParamSwitch(' -getname' ) and IsNXT then
501
501
begin
502
- if BrickComm.NXTGetDeviceInfo (pattern, btaddr, btsig, memFree) then
502
+ if BrickComm.SCGetDeviceInfo (pattern, btaddr, btsig, memFree) then
503
503
Writeln(pattern);
504
504
end ;
505
505
if ParamSwitch(' -freemem' ) and IsNXT then
506
506
begin
507
- if BrickComm.NXTGetDeviceInfo (pattern, btaddr, btsig, memFree) then
507
+ if BrickComm.SCGetDeviceInfo (pattern, btaddr, btsig, memFree) then
508
508
OutputValue(memFree);
509
509
end ;
510
510
if ParamSwitch(' -lsstatus' ) and IsNXT then
511
511
begin
512
512
port := ParamIntValue(' -lsstatus' , 0 );
513
- if BrickComm.NXTLSGetStatus (port, bytesReady, lsstate) then
513
+ if BrickComm.DCLSGetStatus (port, bytesReady, lsstate) then
514
514
OutputValue(bytesReady);
515
515
end ;
516
516
if ParamSwitch(' -btnstate' ) and IsNXT then
517
517
begin
518
518
port := ParamIntValue(' -btnstate' , 0 );
519
- if BrickComm.NXTGetButtonState (port, False, pressed, btncount) then
519
+ if BrickComm.DCGetButtonState (port, False, pressed, btncount) then
520
520
Writeln(Format(' Button %d: pressed = %s, count = %d' , [port, BoolToStr(pressed, True), btncount]));
521
521
end ;
522
522
if ParamSwitch(' -resetbtnstate' ) and IsNXT then
523
523
begin
524
524
port := ParamIntValue(' -resetbtnstate' , 0 );
525
- BrickComm.NXTGetButtonState (port, True, pressed, btncount);
525
+ BrickComm.DCGetButtonState (port, True, pressed, btncount);
526
526
end ;
527
527
if ParamSwitch(' -readmsg' ) and IsNXT then
528
528
begin
529
529
port := ParamIntValue(' -readmsg' , 0 );
530
- if BrickComm.NXTMessageRead (port, ParamIntValue(' /Inbox' , 0 ), ParamSwitch(' /Empty' ), Msg) then
530
+ if BrickComm.DCMessageRead (port, ParamIntValue(' /Inbox' , 0 ), ParamSwitch(' /Empty' ), Msg) then
531
531
begin
532
532
for i := 0 to Msg.Size - 1 do
533
533
OutputValue(Msg.Data[i]);
0 commit comments