msd pinout

This commit is contained in:
Devaev Maxim
2018-10-05 20:03:40 +03:00
parent bbaf99c1b4
commit a87963e300
9 changed files with 65 additions and 6 deletions

View File

@@ -147,6 +147,7 @@ class Server: # pylint: disable=too-many-instance-attributes
app.router.add_get("/msd", self.__msd_state_handler)
app.router.add_post("/msd/connect", self.__msd_connect_handler)
app.router.add_post("/msd/write", self.__msd_write_handler)
app.router.add_post("/msd/reset", self.__msd_reset_handler)
app.router.add_get("/streamer", self.__streamer_state_handler)
app.router.add_post("/streamer/set_params", self.__streamer_set_params_handler)
@@ -298,6 +299,11 @@ class Server: # pylint: disable=too-many-instance-attributes
logger.info("Written %d bytes to mass-storage device", written)
return _json({"written": written})
@_wrap_exceptions_for_web("Mass-storage error")
async def __msd_reset_handler(self, _: aiohttp.web.Request) -> aiohttp.web.Response:
await self.__msd.reset()
return _json()
# ===== STREAMER
async def __streamer_state_handler(self, _: aiohttp.web.Request) -> aiohttp.web.Response: