add logging, fix senddat

This commit is contained in:
Peter McGoron @ planck 2023-04-07 17:40:59 -04:00
parent 56c6523e15
commit 73c5beb90e
1 changed files with 6 additions and 1 deletions

View File

@ -14,10 +14,12 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
#ifndef CREOLE_TEST
# include <zephyr/kernel.h>
# include <zephyr/logging/log.h>
# include <zephyr/sys_clock.h>
# include "access.h"
# include "control_loop_cmds.h"
# include "sock.h"
LOG_MODULE_REGISTER(creole, 4);
#endif
#include "creole.h"
@ -597,7 +599,7 @@ upsilon_sendval(struct creole_env *env, creole_word num)
static creole_word
upsilon_senddat(struct creole_env *env, creole_word db)
{
#define SENDDAT_BUFLEN 128
#define SENDDAT_BUFLEN 1024
char buf[SENDDAT_BUFLEN];
struct bufptr bp = {buf, 0};
struct creole_word w;
@ -608,6 +610,9 @@ upsilon_senddat(struct creole_env *env, creole_word db)
return -EINVAL;
buf[bp.left++] = w.word;
}
if (r.left != 0) {
return -E2BIG;
}
return sock_write_buf(env->fd, &bp);
}