Skip to content
This repository was archived by the owner on Jun 10, 2022. It is now read-only.
This repository was archived by the owner on Jun 10, 2022. It is now read-only.

Adding a button to a keypad doesn't seem to work. #19

@DDevine

Description

@DDevine

I am attempting to create a keypad driver. I have the basic skeleton done, and I am trying to programmatically add buttons but they do not seem to be getting added.

My driver XML looks like this (other details omitted).

...
<proxies>
    <proxy proxybindingid="5002" name="my Keypad">keypad_proxy</proxy>
</proxies><capabilities>
    <has_leds>true</has_leds>
    <has_button_events>true</has_button_events>
    <buttons_are_virtual>false</buttons_are_virtual>
    <hide_proxy_events>false</hide_proxy_events>
    <num_buttons>32</num_buttons>
</capabilities><connections>
    <connection>
        <id>1</id>
        <facing>6</facing>
        <connectionname>my IDC</connectionname>
        <type>1</type>
        <consumer>True</consumer>
        <audiosource>False</audiosource>
        <videosource>False</videosource>
        <linelevel>False</linelevel>
        <classes>
            <class>
                <classname>MY_IDC</classname>
            </class>
        </classes>
        <hidden>False</hidden>
    </connection>
    <connection>
        <id>5002</id>
        <facing>6</facing>
        <connectionname>Keypad</connectionname>
        <type>2</type>
        <consumer>False</consumer>
        <audiosource>False</audiosource>
        <videosource>False</videosource>
        <linelevel>False</linelevel>
        <classes>
            <class>
                <classname>KEYPAD_PROXY</classname>
                <autobind>True</autobind>
            </class>
        </classes>
        <hidden>False</hidden>
    </connection>
</connections>
...

I am unsure about capabilities associated with keypads. Those are my best guess.
Also, my num_buttons might be completely wrong as the documentation looks like it implies there are only 4 values?

I attempt to add a test button like this:

    C4:SendToProxy(5002, "NEW_KEYPAD_BUTTON", {
        BUTTON_ID = 1,
        NAME = "TEST Button",
        ON_COLOR = "00FF00",
        OFF_COLOR = "FF0000",
        SLOTS = 2,
    }, "NOTIFY")

I'd appreciate some guidance or a keypad example project. I could probably create a driver from scratch that does what I need, but I was hoping to use the Keypad API.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions