Compare commits
14 Commits
538675de1d
...
18dbbdb702
Author | SHA1 | Date | |
---|---|---|---|
18dbbdb702 | |||
|
00bacf26e8 | ||
266944b3da | |||
7500eb8c88 | |||
7555d33d7e | |||
dc6d41a1a2 | |||
b8123306b7 | |||
5ed52a657e | |||
|
815333667a | ||
8017760499 | |||
|
da3fe4993d | ||
4fe5d9321a | |||
|
06e1f3dff9 | ||
e319df5e59 |
@ -1,5 +1,4 @@
|
||||
name: Demande de fusion (Pull Request)
|
||||
about: Créez une demande de fusion pour partager votre travail avec le reste de l'équipe
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
|
@ -319,7 +319,6 @@ mod test_decode_ssv_memory {
|
||||
1, 49,
|
||||
];
|
||||
let blocks = decode_ssv_memory(&bytes, bytes.len());
|
||||
println!("{:#?}", blocks);
|
||||
assert_eq!(blocks.len(), 2);
|
||||
}
|
||||
}
|
@ -182,13 +182,10 @@ pub fn decode_zone_memoire(bytes: &[u8]) {
|
||||
situations: Vec::new(),
|
||||
};
|
||||
|
||||
println!("--- Decoding Zone Memoire ---");
|
||||
println!("Taille de la zone mémoire: {}", bytes.len());
|
||||
while current_pos_general < bytes.len() - 1 {
|
||||
num_champ = 0;
|
||||
current_groupe =
|
||||
256 * bytes[current_pos_general] as i32 + bytes[current_pos_general + 1] as i32;
|
||||
println!("-- Nouveau groupe : {}", current_groupe);
|
||||
current_pos_general += 2;
|
||||
|
||||
let longueur_groupe: usize;
|
||||
@ -201,13 +198,11 @@ pub fn decode_zone_memoire(bytes: &[u8]) {
|
||||
acc + (256_i32.pow(i as u32) * bytes[current_pos_general] as i32) as usize
|
||||
});
|
||||
}
|
||||
println!("--- Longueur groupe: {}", longueur_groupe);
|
||||
current_pos_general += 1;
|
||||
|
||||
let mut current_pos_groupe = 0;
|
||||
while current_pos_groupe < longueur_groupe {
|
||||
num_champ += 1;
|
||||
println!("---- Nouveau champ : {}", num_champ);
|
||||
let longueur_champs: usize;
|
||||
let nbre_octets_longueur: usize;
|
||||
if bytes[current_pos_general] < 128 {
|
||||
@ -221,7 +216,6 @@ pub fn decode_zone_memoire(bytes: &[u8]) {
|
||||
acc + (256_i32.pow(i as u32) * bytes[current_pos_general] as i32) as usize
|
||||
});
|
||||
}
|
||||
println!("----- Longueur champ: {}", longueur_champs);
|
||||
|
||||
let mut bytes_champ = vec![0; longueur_champs];
|
||||
if longueur_champs > 0 {
|
||||
@ -229,7 +223,6 @@ pub fn decode_zone_memoire(bytes: &[u8]) {
|
||||
&bytes[current_pos_general + nbre_octets_longueur
|
||||
..current_pos_general + nbre_octets_longueur + longueur_champs],
|
||||
);
|
||||
println!("----- Bytes du champ: {:?}", bytes_champ);
|
||||
|
||||
match current_groupe {
|
||||
1 => match num_champ {
|
||||
@ -381,27 +374,17 @@ pub fn decode_zone_memoire(bytes: &[u8]) {
|
||||
String::from_utf8_lossy(&bytes_champ).to_string();
|
||||
}
|
||||
20 => {
|
||||
carte_ps
|
||||
.situations
|
||||
.last_mut()
|
||||
.unwrap()
|
||||
.habilitation_à_signer_une_facture =
|
||||
carte_ps.situations.last_mut().unwrap().habilitation_à_signer_une_facture =
|
||||
String::from_utf8_lossy(&bytes_champ).to_string();
|
||||
}
|
||||
21 => {
|
||||
carte_ps
|
||||
.situations
|
||||
.last_mut()
|
||||
.unwrap()
|
||||
.habilitation_à_signer_un_lot =
|
||||
carte_ps.situations.last_mut().unwrap().habilitation_à_signer_un_lot =
|
||||
String::from_utf8_lossy(&bytes_champ).to_string();
|
||||
}
|
||||
_ => (),
|
||||
},
|
||||
_ => (),
|
||||
}
|
||||
} else {
|
||||
println!("----- Pas de bytes pour ce champ");
|
||||
}
|
||||
|
||||
current_pos_general += longueur_champs + nbre_octets_longueur;
|
||||
|
Loading…
Reference in New Issue
Block a user