npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bep_sdk

v1.5.6

Published

TODO: Give a short introduction of your project. Let this section explain the objectives or the motivation behind this project.

Downloads

14

Readme

HOW TO USE

  1. npm i [email protected] --legacy-peer-deps
  2. npm i bep_sdk --legacy-peer-deps
  3. import { bepSDK } from 'bep_sdk/publish';

example

bepSDK.ConnectBike(function(output){ console.log(output); });

functions

  1. ConnectBike(callback(Status));
  2. DisconnectBike(callback(Status));
  3. GetSystemInformation(callback(SystemInformation));
  4. GetRideStats(callback(RideStats));
  5. GetBatteryUsage(callback(BatteryUsage))
  6. GetErrorHistory(callback(ErrorRecords));
  7. ClearErrorHistory(callback(Status));
  8. GetErrors(callback(ErrorRecords));
  9. InitializeMotorParameters(MotorParameters, callback(Status));
  10. GetMotorParameters(callback(MotorParameters));
  11. SetMotorParameters(ModifiableMotorParameters, callback(Status));
  12. UploadFirmware(Component, callback(stream UploadFirmwareResponse));
  13. RunDiagnostics(DiagnosticRequest, callback(DiagnosticResponse));
  14. StartBatterySleepMode(callback(Status));
  15. SetPythonPath(Python, callback(Status));
  16. ExportLogsToFile(Logs, callback(Status));

Enumerations

message Logs { string FilePath = 0; bool Enable_Debug = 1; } message Python { string FilePath = 0; } enum ComponentType { MCU = 0; // Motor Control Unit HMI = 1; BATTERY = 2; }

enum MeasuringUnit { IMPERIAL = 0; // MI, MPH METRIC = 1; // KM, KPH }

enum DiagnosticTest { // Motor Diagnostic Tests TEST_SPEED_SENSOR = 0; TEST_TORQUE_SENSOR = 1; TEST_CADENCE_SENSOR = 2; TEST_THROTTLE_DEVICE = 3; TEST_MOTOR_DEVICE = 4; TEST_LIGHT_DEVICE = 5; TEST_BRAKE_SENSOR = 6; TEST_BATTERY_DEVICE = 7;

// HMI Diagnostic Tests
TEST_UP_KEY = 51; 
TEST_DOWN_KEY = 52;
TEST_POWER_KEY = 53;
TEST_BLE = 54;

}

/* Message Definitions */ message Empty {}

message Status { int32 code = 1; // 0 => OK string message = 2; }

message SystemInformation { Status status = 1; // Motor Information string motor_serial_number = 2; string motor_fw_version = 3; string motor_hw_version = 4;

// Proposed additions for Motor System Information
string motor_manufacturer = 5;
string motor_model = 6;
string motor_type = 7;
string motor_part_number = 8;
string motor_region_code = 9;

// HMI Information
string hmi_serial_number = 21;
string hmi_fw_version = 22;
string hmi_hw_version = 23;
string hmi_part_number = 24;
string hmi_region_code = 25;

// Battery Information
string battery_serial_number = 41;
string battery_fw_version = 42;
string battery_hw_version = 43;

}

message RideStats { Status status = 1; int32 odometer = 2; // km int32 total_riding_time = 3; // seconds float max_speed = 4; // km/hr int32 max_rpm = 5; // RPM

// Proposed additions
MeasuringUnit display_unit = 51;

}

message BatteryUsage { Status status = 1; int32 output_voltage = 2; // mV int32 output_current = 3; // mA int32 state_of_charge = 4; // % int32 cycle_count = 5; // Times int32 state_of_health = 6; // %
string last_charge_date = 7; // YYYYMMDD int32 total_discharge_capacity = 8; int32 full_charge_capacity = 9; int32 battery_rest_mAh = 10; int32 max_discharge_current = 11; int32 cell_temparature = 12; int32 max_discharge_temperature = 13; int32 max_charge_temperature = 14; }

message ErrorRecord { int32 code = 1; oneof record { int32 odometer_km = 2; int64 timestamp = 3; // epoch time in seconds } }

message ErrorRecords { Status status = 1; repeated ErrorRecord error_records = 2; }

message MotorParameters { Status status = 1; // Bike Information string bike_serial_number = 2; string bike_sku = 3; string bike_model = 4;

// Speed Configuration
int32 max_speed_pedal_assist = 11;
int32 max_speed_throttle_assist = 12;
int32 wheel_diameter_mm = 13;

// HMI or Display configurations
MeasuringUnit display_unit = 22;

// Accessories
bool walk_assist = 31;

// Aux
bool aux_output = 51;

}

message ModifiableMotorParameters { MeasuringUnit display_unit = 22; bool walk_assist = 31; bool aux_output = 51; }

message Component { ComponentType component = 1; }

message UploadFirmwareResponse { Status status = 1; string version = 2; int32 progress = 3; }

message DiagnosticRequest { DiagnosticTest test_name = 1; }

message DiagnosticResponse { Status status = 1; // status of the diagnostic request command repeated ErrorRecord error_records = 2; oneof value { int32 speed = 12; // output for TEST_SPEED_SENSOR int32 torque = 13; // output for TEST_TORQUE_SENSOR int32 cadence = 14; // output for TEST_CADENCE_SENSOR int32 voltage = 15; // output for TEST_THROTTLE_DEVICE, TEST_BATTERY_DEVICE bool switch_state = 16; // output for TEST_LIGHT_DEVICE } }