/*
 * @Author: zchuo zhengchen.huo@lnxall.com
 * @Date: 2024-12-06 11:01:07
 * @LastEditors: zchuo zhengchen.huo@lnxall.com
 * @LastEditTime: 2024-12-27 10:04:53
 * @FilePath: /proto_forward/src/adapter/BMS/BMS.c
 * @Description: 
 * 
 * Copyright (c) 2024 by ${git_name_email}, All Rights Reserved. 
 */
#include "../pe_adapter.h"
#include <string.h>
#include <stdlib.h>
#include <stdio.h>

int BMS_init(pe_class* this_p, void* par)
{
    return 0;
}


int BMS_get_power(pe_class *this_p, double *power)
{
    int ret = 0;

    ret = adapter_function_get_double(this_p, "get_power", power);
    if( -1 == ret)
    {
        *power = 0;

    }
    
    return ret;
}


static char* bms_compatible_arr[] = {"bms", NULL};

pe_adapter bms_adp __at_pe_adp_section = {
    .init = BMS_init,
    .set_power = NULL,
    .get_power = BMS_get_power,

    .compatible = bms_compatible_arr, // 属性
    .set_repower = NULL,
    .set_mode = NULL,
    .set_onoff = NULL,
    .set_connect = NULL,
    .get_repower = NULL,
    .get_mode = NULL,
    .get_onoff = NULL,
    .get_connect = NULL,
};
