{"id":13812703,"url":"https://github.com/esynr3z/atat","last_synced_at":"2026-01-02T03:08:05.229Z","repository":{"id":130104077,"uuid":"144311266","full_name":"esynr3z/atat","owner":"esynr3z","description":"Lib for AT-like custom commands processing","archived":false,"fork":false,"pushed_at":"2018-08-10T16:50:05.000Z","size":5,"stargazers_count":6,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-19T07:39:01.187Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/esynr3z.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-10T16:49:12.000Z","updated_at":"2024-02-22T14:31:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"e3ba5e3f-013b-4650-b853-eb00dd645245","html_url":"https://github.com/esynr3z/atat","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esynr3z%2Fatat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esynr3z%2Fatat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esynr3z%2Fatat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esynr3z%2Fatat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/esynr3z","download_url":"https://codeload.github.com/esynr3z/atat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254239465,"owners_count":22037714,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T04:00:54.658Z","updated_at":"2026-01-02T03:08:00.196Z","avatar_url":"https://github.com/esynr3z.png","language":"C","funding_links":[],"categories":["Protocols"],"sub_categories":["Protocol Parsers"],"readme":"## What is it?\n\nIt's a C library called \"ATAT\" (yes, almost like that huge [armored walker](http://starwars.wikia.com/wiki/All_Terrain_Armored_Transport) from the Star Wars =)) which implements AT-like commands processing. This lib doesn't provide a list of ready commands but gives you a tool to create this list easily yourself, special for your project and needs. ATAT can be used in many many embed devices, which need to be configurated and controlled by simple and clear protocol through widely used UART-USB and UART-Bluetooth converters.\nIf you don't know what is \"AT command\" - [Wiki](https://en.wikipedia.org/wiki/Hayes_command_set#GSM).\n\n##  How to use?\n\n* Include ```atat.h``` to your app ```main.c``` file or another where you want to use lib\n* Call ```ATAT_Init()``` function to init lib\n* You can use ```ATAT_*HandlerInit()``` to define your own handlers for commands\n* Place ```ATAT_GetSymbol()``` function, for example, in interrupt handler from UART Rx where it can recieve frames byte-by-byte and process them.\n\nExample of code (pseudocode):\n```\n#include \"atat.h\"\n\nvoid test_exec_handler()\n{\n    printf(\"Function test_exec_handler() was called!\\n\");\n}\n\nint main(void)\n{\n    ATAT_Init();\n    ATAT_ExecHandlerInit(ATAT_CmdID_Test, \u0026test_exec_handler);\n    UART_Init();\n\n    while(1);\n    return 0;\n}\n\nUART_IRQHandler()\n{\n    ATAT_GetSymbol(UART_ReceiveByte());\n    UART_ClearFlags();\n}\n```\n\n## Protocol\n\nAll frames from host should start from header ```AT``` and should end by CRLF ```\\r\\n```.\nAlso answers from device will be ended the same.\n\nThe simplest command is ```AT```. It performs an action like \"ping\", and answer will be:\n```\nAT\nOK\n```\n\nCommands should start from ```+``` and should be placed right after ```AT``` header:\n```\nAT+TEST\n```\n\nEvery command have modifier after it. It will define which handler will be called on device: \n\n* Execution modifier (empty modifier) - call handler which performs some actions\n```\nAT+TEST\nOK\n```\n\n* Get modifier ```?``` - call handler which request some values\n```\nAT+TEST?\n+TEST=test_value\nOK\n```\n\n* Set modifier ```=``` - call handler which write some values\n```\nAT+TEST=new_value\nOK\n```\n\nDevice will answer with this statuses, if an error occured:\n\n* ```ERROR=BUFFER_OVEFLOW``` - if receive buffer oferflow happened\n\n* ```ERROR=NO_HANDLER``` - if no handler defined for this combination of command and modifier\n\n* ```ERROR=UNKNOWN_HEADER``` - corrupted frame, header not recognized\n\n* ```ERROR=UNKNOWN_COMMAND``` - corrupted or not recognized command\n\n* ```ERROR=UNKNOWN_MODIFIER``` -  corrupted or not recognized modifier\n\n## How to implement your own command\n\n* Add ID of your command to enum ```ATAT_CmdID_TypeDef``` in ```atat.h```\n\n* Add a string with command mnemonic to ```Command strings``` section in ```atat.c```. Remember, that every command should start from ```+``` and have not more than 15 symbols next (by default).\n\n* Place init code for your command in ```ATAT_Init()``` function (```atat.c``` file)\n\n* Define command hanlers (exec, set or get) in user code by ```ATAT_*HandlerInit()``` function","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesynr3z%2Fatat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fesynr3z%2Fatat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesynr3z%2Fatat/lists"}