1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2012 Amaury Pouly
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
40 } __attribute__((packed
));
45 } __attribute__((packed
));
47 #define YP_SIGNATURE "SAMSUNG YEPP"
53 struct samsung_firmware_t
66 SAMSUNG_READ_ERROR
= -1,
67 SAMSUNG_FORMAT_ERROR
= -2,
68 SAMSUNG_MD5_ERROR
= -3,
69 SAMSUNG_WRITE_ERROR
= -4,
72 typedef int (*samsung_read_t
)(void *user
, int offset
, void *buffer
, int size
);
73 typedef int (*samsung_write_t
)(void *user
, int offset
, void *buffer
, int size
);
74 typedef void (*samsung_printf_t
)(void *user
, bool error
, const char *fmt
, ...);
76 struct samsung_firmware_t
*samsung_read(samsung_read_t read
,
77 samsung_printf_t printf
, void *user
, enum samsung_error_t
*err
);
78 enum samsung_error_t
samsung_write(samsung_write_t write
, samsung_printf_t printf
,
79 void *user
, struct samsung_firmware_t
*fw
);
80 void samsung_free(struct samsung_firmware_t
*fw
);
82 #endif /* __SAMSUNG_H__ */