#3 Turn heartbeatcolor into an api

open
nobody
5
2007-02-13
2007-02-13
Sache the Bunny
No

Convert into something that can be controlled trough api (e.g api.php?sn=xxxx&heartbeat=0,1,0) the "one shot" plugin created by Oaz:

class Plugin_heartbeatcolor extends Plugin
{
function OnBoot(&$burrow,&$request)
{
$request->reply[35183] = chr(0);
$request->reply[35184] = chr(1);
$request->reply[35185] = chr(0);
}
}

..based on the following info I found:

".... may modify the bc.jsp currently sent by violet in order to change the color of the "heartbeat" at the bottom of the bunny.

The original has:
Offset 0x896e is 03 01 00 01 00
--------------------BB GG RR

If you modify the bytes from 0 to 1 you'll change the heartbeat.

So
03 01 00 00 00 -> blue heartbeat
03 00 01 01 00 -> red+green -> yellow heartbeat

If you use other values (.e.g: 03 c0 c0 00 00) you'll have funny multicolored heartbeats. (CAUTION, this might fry your LEDs if played for a long time)

Discussion

  • Olivier Azeau
    Olivier Azeau
    2007-02-13

    • labels: --> plugin/heartbeatcolor
     
  • Logged In: YES
    user_id=1716509
    Originator: YES

    UPDATE for bc.jsp version 65806
    The 3 bytes to change are now at offsets 0x9a50-0x9a52. So:

    $request->reply[0x9A50] = chr(0);
    $request->reply[0x9A51] = chr(1);
    $request->reply[0x9A52] = chr(0);

    gives the green heartbeat