posiflex-hidcd


Nameposiflex-hidcd JSON
Version 1.0.0 PyPI version JSON
download
home_page
SummaryUSB HID Cash Drawer Interface
upload_time2024-02-29 23:11:51
maintainer
docs_urlNone
author
requires_python>=3.9
licenseMIT
keywords posiflex cr-4xxx usb hid
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # posiflex-hidcd

Example interface for Posiflex USB HID Cash Drawer

## Usage

	from hidcd import HidCd
	cd = HidCd(7)  # use cash drawer with id=7
	if cd.closed():
	    cd.open()

## Requirements

   - [hidapi-cffi](https://pypi.org/project/hidapi-cffi/)

On linux, read/write access to the hid device
file may be required. See example udev rule
72-posiflex-hid.rules for a possible approach.

## Device Info

Tested with Posiflex CR-4115G2/CR-4000 Series:

	ID 0d3a:020X Posiflex Technologies, Inc. Series 3xxx Cash Drawer

HID Descriptor:

	0x06, 0xA0, 0xFF,  // Usage Page (Vendor Defined 0xFFA0)
	0x09, 0x01,        // Usage (0x01)
	0xA1, 0x01,        // Collection (Application)
	0x09, 0x02,        //   Usage (0x02)
	0x15, 0x00,        //   Logical Minimum (0)
	0x26, 0xFF, 0x00,  //   Logical Maximum (255)
	0x75, 0x08,        //   Report Size (8)
	0x95, 0x78,        //   Report Count (120)
	0x81, 0x02,        //   Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
	0x09, 0x03,        //   Usage (0x03)
	0x15, 0x00,        //   Logical Minimum (0)
	0x26, 0xFF, 0x00,  //   Logical Maximum (255)
	0x75, 0x08,        //   Report Size (8)
	0x95, 0x78,        //   Report Count (120)
	0x91, 0x02,        //   Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
	0xC0,              // End Collection
 
## Protocol

Command (120 bytes, host to device):

	[CDNUM] [COMMAND] 0x00 ... 0x00

   - [CDNUM] is the drawer number (0-7)
   - [COMMAND] is one of:
      - CDNUM: Open drawer
      - CDNUM+1: Drawer status

Status (120 bytes, device to host):

	[STATUS] 0x?? ... 0x??

   - STATUS is (CDNUM<<4)|CLOSED:
      - CLOSED==0: Drawer is open
      - CLOSED==1: Drawer is closed

## Notes

   - Open command is the drawer number
   - Status command is drawer number plus one
   - Command D0 returns garbage bytes from cash drawer
   - Commands C0 and E0 do not appear to function
   - Command F0 will set device into ISP (bootloader) mode

If cash drawer is in ISP (bootloader) mode, it will report a
USB product ID of 0x0c23:

	ID 0d3a:0c23 Posiflex Technologies, Inc. USB  MSR  BL V200

In this case, the Posiflex firmware programming util (available
from manufacturer tech support) can be used to revert the
device to HID mode and restore function. The tool may also be
used to convert the device to "Virtual Com Port" mode which
may be more convenient.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "posiflex-hidcd",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "posiflex,cr-4xxx,usb,hid",
    "author": "",
    "author_email": "Nathan Fraser <ndf-zz@6-v.org>",
    "download_url": "https://files.pythonhosted.org/packages/8e/eb/2d4465cbe0095e21bf996035d7bc893619e36a83c7bb01261815dda81bab/posiflex-hidcd-1.0.0.tar.gz",
    "platform": null,
    "description": "# posiflex-hidcd\n\nExample interface for Posiflex USB HID Cash Drawer\n\n## Usage\n\n\tfrom hidcd import HidCd\n\tcd = HidCd(7)  # use cash drawer with id=7\n\tif cd.closed():\n\t    cd.open()\n\n## Requirements\n\n   - [hidapi-cffi](https://pypi.org/project/hidapi-cffi/)\n\nOn linux, read/write access to the hid device\nfile may be required. See example udev rule\n72-posiflex-hid.rules for a possible approach.\n\n## Device Info\n\nTested with Posiflex CR-4115G2/CR-4000 Series:\n\n\tID 0d3a:020X Posiflex Technologies, Inc. Series 3xxx Cash Drawer\n\nHID Descriptor:\n\n\t0x06, 0xA0, 0xFF,  // Usage Page (Vendor Defined 0xFFA0)\n\t0x09, 0x01,        // Usage (0x01)\n\t0xA1, 0x01,        // Collection (Application)\n\t0x09, 0x02,        //   Usage (0x02)\n\t0x15, 0x00,        //   Logical Minimum (0)\n\t0x26, 0xFF, 0x00,  //   Logical Maximum (255)\n\t0x75, 0x08,        //   Report Size (8)\n\t0x95, 0x78,        //   Report Count (120)\n\t0x81, 0x02,        //   Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)\n\t0x09, 0x03,        //   Usage (0x03)\n\t0x15, 0x00,        //   Logical Minimum (0)\n\t0x26, 0xFF, 0x00,  //   Logical Maximum (255)\n\t0x75, 0x08,        //   Report Size (8)\n\t0x95, 0x78,        //   Report Count (120)\n\t0x91, 0x02,        //   Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)\n\t0xC0,              // End Collection\n \n## Protocol\n\nCommand (120 bytes, host to device):\n\n\t[CDNUM] [COMMAND] 0x00 ... 0x00\n\n   - [CDNUM] is the drawer number (0-7)\n   - [COMMAND] is one of:\n      - CDNUM: Open drawer\n      - CDNUM+1: Drawer status\n\nStatus (120 bytes, device to host):\n\n\t[STATUS] 0x?? ... 0x??\n\n   - STATUS is (CDNUM<<4)|CLOSED:\n      - CLOSED==0: Drawer is open\n      - CLOSED==1: Drawer is closed\n\n## Notes\n\n   - Open command is the drawer number\n   - Status command is drawer number plus one\n   - Command D0 returns garbage bytes from cash drawer\n   - Commands C0 and E0 do not appear to function\n   - Command F0 will set device into ISP (bootloader) mode\n\nIf cash drawer is in ISP (bootloader) mode, it will report a\nUSB product ID of 0x0c23:\n\n\tID 0d3a:0c23 Posiflex Technologies, Inc. USB  MSR  BL V200\n\nIn this case, the Posiflex firmware programming util (available\nfrom manufacturer tech support) can be used to revert the\ndevice to HID mode and restore function. The tool may also be\nused to convert the device to \"Virtual Com Port\" mode which\nmay be more convenient.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "USB HID Cash Drawer Interface",
    "version": "1.0.0",
    "project_urls": {
        "homepage": "https://github.com/ndf-zz/posiflex-hidcd"
    },
    "split_keywords": [
        "posiflex",
        "cr-4xxx",
        "usb",
        "hid"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e9ffccfdf70b538cce9d0e8f1edae92d2e1b376e3197905f427dcbcd4ba1da51",
                "md5": "e6b6bdd8622dd4c3002440aaa3e4e915",
                "sha256": "4b7acd3e7f9e810fd9a63b9b3aa677e5654fb30ed8e72328151c5d618c1fee9b"
            },
            "downloads": -1,
            "filename": "posiflex_hidcd-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e6b6bdd8622dd4c3002440aaa3e4e915",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 4373,
            "upload_time": "2024-02-29T23:11:49",
            "upload_time_iso_8601": "2024-02-29T23:11:49.017962Z",
            "url": "https://files.pythonhosted.org/packages/e9/ff/ccfdf70b538cce9d0e8f1edae92d2e1b376e3197905f427dcbcd4ba1da51/posiflex_hidcd-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8eeb2d4465cbe0095e21bf996035d7bc893619e36a83c7bb01261815dda81bab",
                "md5": "0325f486b2c43916caa4f7ad075c8d8e",
                "sha256": "eaaf0d5716414f93a618f6d80233ff6c0f14ef8212cb3313292c46a3c5f06424"
            },
            "downloads": -1,
            "filename": "posiflex-hidcd-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "0325f486b2c43916caa4f7ad075c8d8e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 4073,
            "upload_time": "2024-02-29T23:11:51",
            "upload_time_iso_8601": "2024-02-29T23:11:51.671078Z",
            "url": "https://files.pythonhosted.org/packages/8e/eb/2d4465cbe0095e21bf996035d7bc893619e36a83c7bb01261815dda81bab/posiflex-hidcd-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-29 23:11:51",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ndf-zz",
    "github_project": "posiflex-hidcd",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "posiflex-hidcd"
}
        
Elapsed time: 0.19599s