<commit_before>/*
 * BRLTTY - A background process providing access to the console screen (when in
 *          text mode) for a blind person using a refreshable braille display.
 *
 * Copyright (C) 1995-2019 by The BRLTTY Developers.
 *
 * BRLTTY comes with ABSOLUTELY NO WARRANTY.
 *
 * This is free software, placed under the terms of the
 * GNU Lesser General Public License, as published by the Free Software
 * Foundation; either version 2.1 of the License, or (at your option) any
 * later version. Please see the file LICENSE-LGPL for details.
 *
 * Web Page: http://brltty.app/
 *
 * This software is maintained by <NAME> <<EMAIL>>.
 */

#ifndef BRLTTY_INCLUDED_FS_BRLDEFS
#define BRLTTY_INCLUDED_FS_BRLDEFS

typedef enum {
  FS_PKT_QUERY  = 0X00, /* host->unit: request device information */
  FS_PKT_ACK    = 0X01, /* unit->host: acknowledge packet receipt */
  FS_PKT_NAK    = 0X02, /* unit->host: negative acknowledge, report error */
  FS_PKT_KEY    = 0X03, /* unit->host: key event */
  FS_PKT_BUTTON = 0X04, /* unit->host: routing button event */
  FS_PKT_WHEEL  = 0X05, /* unit->host: whiz wheel event */
  FS_PKT_HVADJ  = 0X08, /* host->unit: set braille display voltage */
  FS_PKT_BEEP   = 0X09, /* host->unit: sound short beep */
  FS_PKT_CONFIG = 0X0F, /* host->unit: configure device options */
  FS_PKT_INFO   = 0X80, /* unit->host: response to query packet */
  FS_PKT_WRITE  = 0X81, /* host->unit: write to braille display */
  FS_PKT_EXTKEY = 0X82  /* unit->host: extended keys event */
} FS_PacketType;

typedef enum {
  FS_EXT_HVADJ    = 0X08, /* error in varibraille packet */
  FS_EXT_BEEP     = 0X09, /* error in beep packet */
  FS_EXT_CLEAR    = 0X31, /* error in ClearMsgBuf function */
  FS_EXT_LOOP     = 0X32, /* timing loop in ParseCommands function */
  FS_EXT_TYPE     = 0X33, /* unknown packet type in ParseCommands function */
  FS_EXT_CMDWRITE = 0X34, /* error in CmdWrite function */
  FS_EXT_UPDATE   = 0X7E, /* error in update packet */
  FS_EXT_DIAG     = 0X7F, /* error in diag packet */
  FS_EXT_QUERY    = 0X80, /* error in query packet */
  FS_EXT_WRITE    = 0X81  /* error in write packet */
} FS_PacketExtended;

typedef enum {
  FS_ERR_TIMEOUT   = 0X30, /* no data received from host for a while */
  FS_ERR_CHECKSUM  = 0X31, /* incorrect checksum */
  FS_ERR_TYPE      = 0X32, /* unsupported packet type */
  FS_ERR_PARAMETER = 0X33, /* invalid parameter */
  FS_ERR_SIZE      = 0X34, /* write size too large */
  FS_ERR_POSITION  = 0X35, /* write position too large */
  FS_ERR_OVERRUN   = 0X36, /* message queue overflow */
  FS_ERR_POWER     = 0X37, /* insufficient USB power */
  FS_ERR_SPI       = 0X38  /* timeout on SPI bus */
} FS_PacketError;

typedef enum {
  FS_CFG_EXTKEY = 0X02  /* send extended key events */
} FS_ConfigFlag;

typedef struct {
  unsigned char type;
  unsigned char arg1;
  unsigned char arg2;
  unsigned char arg3;
} FS_PacketHeader;

#define FS_INFO_MANUFACTURER_SIZE 24
#define FS_INFO_MODEL_SIZE 16<commit_msg>Give a couple of FS braille driver types better names. (dm)<commit_after>/*
 * BRLTTY - A background process providing access to the console screen (when in
 *          text mode) for a blind person using a refreshable braille display.
 *
 * Copyright (C) 1995-2019 by The BRLTTY Developers.
 *
 * BRLTTY comes with ABSOLUTELY NO WARRANTY.
 *
 * This is free software, placed under the terms of the
 * GNU Lesser General Public License, as published by the Free Software
 * Foundation; either version 2.1 of the License, or (at your option) any
 * later version. Please see the file LICENSE-LGPL for details.
 *
 * Web Page: http://brltty.app/
 *
 * This software is maintained by <NAME> <<EMAIL>>.
 */

#ifndef BRLTTY_INCLUDED_FS_BRLDEFS
#define BRLTTY_INCLUDED_FS_BRLDEFS

typedef enum {
  FS_PKT_QUERY  = 0X00, /* host->unit: request device information */
  FS_PKT_ACK    = 0X01, /* unit->host: acknowledge packet receipt */
  FS_PKT_NAK    = 0X02, /* unit->host: negative acknowledge, report error */
  FS_PKT_KEY    = 0X03, /* unit->host: key event */
  FS_PKT_BUTTON = 0X04, /* unit->host: routing button event */
  FS_PKT_WHEEL  = 0X05, /* unit->host: whiz wheel event */
  FS_PKT_HVADJ  = 0X08, /* host->unit: set braille display voltage */
  FS_PKT_BEEP   = 0X09, /* host->unit: sound short beep */
  FS_PKT_CONFIG = 0X0F, /* host->unit: configure device options */
  FS_PKT_INFO   = 0X80, /* unit->host: response to query packet */
  FS_PKT_WRITE  = 0X81, /* host->unit: write to braille display */
  FS_PKT_EXTKEY = 0X82  /* unit->host: extended keys event */
} FS_PacketType;

typedef enum {
  FS_EXT_HVADJ    = 0X08, /* error in varibraille packet */
  FS_EXT_BEEP     = 0X09, /* error in beep packet */
  FS_EXT_CLEAR    = 0X31, /* error in ClearMsgBuf function */
  FS_EXT_LOOP     = 0X32, /* timing loop in ParseCommands function */
  FS_EXT_TYPE     = 0X33, /* unknown packet type in ParseCommands function */
  FS_EXT_CMDWRITE = 0X34, /* error in CmdWrite function */
  FS_EXT_UPDATE   = 0X7E, /* error in update packet */
  FS_EXT_DIAG     = 0X7F, /* error in diag packet */
  FS_EXT_QUERY    = 0X80, /* error in query packet */
  FS_EXT_WRITE    = 0X81  /* error in write packet */
} FS_ExtendedPacketType;

typedef enum {
  FS_ERR_TIMEOUT   = 0X30, /* no data received from host for a while */
  FS_ERR_CHECKSUM  = 0X31, /* incorrect checksum */
  FS_ERR_TYPE      = 0X32, /* unsupported packet type */
  FS_ERR_PARAMETER = 0X33, /* invalid parameter */
  FS_ERR_SIZE      = 0X34, /* write size too large */
  FS_ERR_POSITION  = 0X35, /* write position too large */
  FS_ERR_OVERRUN   = 0X36, /* message queue overflow */
  FS_ERR_POWER     = 0X37, /* insufficient USB power */
  FS_ERR_SPI       = 0X38  /* timeout on SPI bus */
} FS_ErrorCode;

typedef enum {
  FS_CFG_EXTKEY = 0X02  /* send extended key events */
} FS_ConfigFlag;

typedef struct {
  unsigned char type;
  unsigned char arg1;
  unsigned char arg2;
  unsigned char arg3;
} FS_PacketHeader;

#define FS_INFO_MANUFACTURER_SIZE 24
#define FS_INFO_MODEL_SIZE 16
{'fraction_non_alphanumeric': 0.10039695666556402, 'fraction_numerical': 0.03638769434336751, 'mean_word_length': 3.1876731301939056, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3009022', 'n_tokens_mistral': 2345, 'n_tokens_neox': 2084, 'n_words': 651}