fcp package

Subpackages

Submodules

fcp.c_generator module

c-generator.

Usage:

c-generator.py generate <json> <template> <skel> <output> c-generator.py (-h | –help) c-generator.py –version

Options:

-h –help Show this screen. –version Show version.

fcp.c_generator.c_gen(spec, templates, output, skel, logger)[source]
fcp.c_generator.check_output(output)[source]
fcp.c_generator.check_version(j, logger)[source]
fcp.c_generator.write_files(output, files)[source]

fcp.can module

class fcp.can.CANMessage(sid: int, dlc: int, timestamp: int, data16: List[int] = [], data64=-1)[source]

Bases: object

static decode_CANmessage(message)[source]
static decode_bstring(bstring)[source]

Decode bytestring encoded message into CANMessage.

See encode_bstring for details on the string format used.

static decode_json(j)[source]

Decode JSON encoded message into CANMessage.

See encode_json for details on the JSON format used.

static decode_kvaser_csv(csv, start_time)[source]
static decode_socketcan(msg)[source]
static decode_struct(s)[source]

Decode C struct encoded message into CANMessage.

See encode_struct for details on the struct format used.

encode_bstring()[source]

Encode message as a utf-8 byte string encoded comma separated list of fields. Example: 100,8,1,2,3,4,1. Encodes sid: 100, dlc: 8, data[0]: 1, data[1]: 2, data[2]: 3, data[3]: 4, timestamp: 1

encode_json()[source]

Encode message as a utf-8 byte string encoded JSON object. Example: {‘sid’: 100, ‘dlc’: 8, ‘data’: [1,2,3,4], ‘timestamp’: 1}

encode_socketcan()[source]
encode_struct()[source]

Encode message as a CAN struct:

typedef struct {
    union {
        struct {
                uint16_t dev_id:5; // Least significant
                // First bit of msg_id determines if msg is reserved or not.
                // 0 == reserved (higher priority) (0-31 decimal)
                uint16_t msg_id:6; // Most significant
        };
        uint16_t sid;
    };
    uint16_t dlc:4;
    uint16_t data[4];
} CANdata;
get_data16()[source]
get_data64()[source]
get_data8()[source]
get_dev_id()[source]
get_msg_id()[source]
fcp.can.test_decode_bstring()[source]
fcp.can.test_decode_json()[source]
fcp.can.test_decode_kvaser_csv()[source]
fcp.can.test_encode_bstring()[source]
fcp.can.test_encode_json()[source]
fcp.can.test_encode_struct()[source]

fcp.dbc_reader module

fcp.dbc_writer module

fcp.dbc_writer.is_decimal(signal)[source]
fcp.dbc_writer.is_float(signal)[source]
fcp.dbc_writer.is_multiplexer(signal, mux_signals)[source]
fcp.dbc_writer.is_signed(signal)[source]
fcp.dbc_writer.make_signal(signal, mux_signals, dev_name)[source]
fcp.dbc_writer.process_mux_signals(signals)[source]
fcp.dbc_writer.write_dbc(spec, dbc)[source]

fcp.device module

fcp.docs module

fcp.docs.check_out_dir(out)[source]

Create output directory.

Out:

output directory path.

Returns:

Failure and error message.

fcp.docs.generate_docs(spec, out, link_location, logger)[source]
fcp.docs.markdown(spec, root)[source]

fcp.docs_css module

fcp.fcp_lib module

fcp.generator module

fcp.generator.build_can_ids(spec, tpl)[source]
fcp.generator.build_common(spec, tpl)[source]
fcp.generator.build_devices(spec, device, tpl)[source]
fcp.generator.build_enums(spec, tpl)[source]
fcp.generator.build_msg_sig(device)[source]
fcp.generator.date()[source]
fcp.generator.decode_signal_sig(device, message, signal)[source]
fcp.generator.decode_signature(device, message, signal)[source]
fcp.generator.device_struct_sig(device)[source]
fcp.generator.dst_type_decide(signal: Signal)[source]
fcp.generator.enum_endianess(signal)[source]
fcp.generator.enum_type(signal)[source]
fcp.generator.msg_struct_sig(device, message)[source]
fcp.generator.multiplexor(signal, message)[source]
fcp.generator.spec_struct_sig(spec)[source]

fcp.gui module

fcp.input module

fcp.input.to_type(str, f)[source]

fcp.spec module

fcp.template module

class fcp.template.Tpl(logger, template_dir)[source]

Bases: object

check_tpl_dir()[source]
open_tpl_files()[source]
render(name, *args, **kwargs)[source]

fcp.validator module

c-generator.

Usage:

validator.py validate <json> validator.py (-h | –help) validator.py –version

Options:

-h –help Show this screen. –version Show version.

fcp.validator.check(category, arg)[source]
fcp.validator.check_decorator(category)[source]
fcp.validator.fail_msg(node, msg, level='error')[source]
fcp.validator.format_error(level, message)[source]
fcp.validator.spec_repeated_names(spec)[source]
fcp.validator.validate(spec)[source]

fcp.version module

Module contents