I don't know either where the 0x26 and 0x27 values come from. That is, besides Romain's analysis of what goes through the link port when TI-Connect does the same operation, of course

Git tells me that the original form of the code I reproduced in
./200 was introduced by Romain at r1116 ("TI89 & TI92 support imported. Small macro fixes in commands.") on Sat May 21 14:08:50 2005 +0000, and that the current form was committed by Romain at r1327 ("Clock support finished") on Tue Jul 5 15:42:00 2005 +0000.
0x26 and 0x27 take precedence over the real vartype of the variable (0x21 for an assembly program, etc.), which means that any proper PedroM support for those vartypes (even if you decide not to add variable locking and archiving code this late in the RC series) needs to perform tag -> vartype mapping (so as to be able to reject, e.g., archived GDB variables or geometry figures, which PedroM has no clue about).
The clock setting and getting code, in calc_89.c, is as follows:
static int set_clock (CalcHandle* handle, CalcClock* clock)
{
uint8_t buffer[16] = { 0 };
uint16_t status;
buffer[6] = clock->year >> 8;
buffer[7] = clock->year & 0x00ff;
buffer[8] = clock->month;
buffer[9] = clock->day;
buffer[10] = clock->hours;
buffer[11] = clock->minutes;
buffer[12] = clock->seconds;
buffer[13] = clock->date_format;
buffer[14] = clock->time_format;
buffer[15] = 0xff;
g_snprintf(update_->text, sizeof(update_->text), _("Setting clock..."));
update_label();
TRYF(ti89_send_RTS(0x10, TI89_CLK, "Clock"));
TRYF(ti89_recv_ACK(NULL));
TRYF(ti89_recv_CTS());
TRYF(ti89_send_ACK());
TRYF(ti89_send_XDP(0x10, buffer));
TRYF(ti89_recv_ACK(NULL));
TRYF(ti89_send_EOT());
TRYF(ti89_recv_ACK(&status));
return 0;
}
static int get_clock (CalcHandle* handle, CalcClock* clock)
{
uint32_t varsize;
uint8_t vartype;
char varname[9];
uint8_t buffer[32];
g_snprintf(update_->text, sizeof(update_->text), _("Getting clock..."));
update_label();
TRYF(ti89_send_REQ(0x0000, TI89_CLK, "Clock"));
TRYF(ti89_recv_ACK(NULL));
TRYF(ti89_recv_VAR(&varsize, &vartype, varname));
TRYF(ti89_send_ACK());
TRYF(ti89_send_CTS());
TRYF(ti89_recv_ACK(NULL));
TRYF(ti89_recv_XDP(&varsize, buffer));
TRYF(ti89_send_ACK());
TRYF(ti89_recv_EOT());
TRYF(ti89_send_ACK());
clock->year = (buffer[6] << 8) | buffer[7];
clock->month = buffer[8];
clock->day = buffer[9];
clock->hours = buffer[10];
clock->minutes = buffer[11];
clock->seconds = buffer[12];
clock->date_format = buffer[13];
clock->time_format = buffer[14];
return 0;
}
Have a good night
