#include <zephyr/kernel.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <dfu/dfu_target_mcuboot.h>
#include <zephyr/settings/settings.h>

#include <zephyr/bluetooth/bluetooth.h>

static uint8_t buf[512] __aligned(4);

void callback_handler(enum dfu_target_evt_id evt)
{
	printf("callback_handler\n");
}

int main(void)
{
	int err;
	err = bt_enable(NULL);
	if (err) {
		printk("Bluetooth init failed (err %d)\n", err);
		return 0;
	}


    uint32_t offset = 0;
    dfu_target_mcuboot_set_buf(buf, sizeof(buf));
    dfu_target_init(DFU_TARGET_IMAGE_TYPE_MCUBOOT, 0, 0, callback_handler);
	dfu_target_offset_get(&offset);

	printf("Offset: %d\n", offset);

	while(true)	{
		k_sleep(K_MSEC(1000));
		printf(".\n");
	}

	return 0;
}
